33
loading...
This website collects cookies to deliver better user experience
client
object for the bot has a method change_presence
. This is used to change the status of your bot!import discord
from discord.ext import commands
client = discord.Client()
@client.event
async def on_ready():
await client.change_presence(status=discord.Status.Online, activity=discord.game('a video game'))
print('We have logged in as {0.user}'.format(client))
Note: Discord only supports streaming links for YouTube and Twitch. The url argument must be formatted as an actual URL. http://www.twitch.tv
will work while www.twitch.tv
will not. It won’t change the bot status at all.
import discord
from discord.ext import commands
client = discord.Client
@client.event
async def on_ready():
await client.change_presence(activity=discord.Streaming(name='a movie', url='https://www.twitch.tv/your_channel_here'))
print('We have logged in as {0.user}'.format(client))
Use discord.Activity()
with the type argument set to discord.ActivityType.watching
for the watching status.import discord
from discord.ext import commands
client = discord.Client
@client.event
async def on_ready():
await client.change_presence(activity=discord. Activity(type=discord.ActivityType.watching, name='A Movie'))
print('We have logged in as {0.user}'.format(client))
Use discord.Activity()
with the type argument set to discord.ActivityType.listening
for the listening status.import discord
from discord.ext import commands
client = discord.Client
@client.event
async def on_ready():
await client.change_presence(activity=discord. Activity(type=discord.ActivityType.listening, name='To Music'))
print('We have logged in as {0.user}'.format(client))
import discord
from discord.ext import commands
# Change below's prefix with your prefix
client = commands.Bot(command.prefix = 'ENTER YOUR PREFIX')
@client.event
async def on_ready():
await client.change_presence(status=discord.Status.Online, activity=discord.game('a video game'))
# You can change the current status above
client.run('Your Bot Token')