discord.status python code example
Example 1: discord.py watching status
await bot.change_presence(activity=discord.Game(name="a game"))
await bot.change_presence(activity=discord.Streaming(name="My Stream", url=my_twitch_url))
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name="a song"))
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="a movie"))
Example 2: python discord
import discord
class MyClient(discord.Client):
async def on_ready(self):
print('Logged on as', self.user)
async def on_message(self, message):
if message.author == self.user:
return
if message.content == 'ping':
await message.channel.send('pong')
client = MyClient()
client.run('token')