is talking discord.py code example

Example 1: discord.py watching status

# Setting `Playing ` status
await bot.change_presence(activity=discord.Game(name="a game"))

# Setting `Streaming ` status
await bot.change_presence(activity=discord.Streaming(name="My Stream", url=my_twitch_url))

# Setting `Listening ` status
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name="a song"))

# Setting `Watching ` status
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="a movie"))

Example 2: how to check if chat is nsfw discord.py

channel_nsfw = await self.is_nsfw(ctx.message.channel)
if channel_nsfw:
	print("NSFW!")