From eb86541fea929577bc80c50ed3fda06db135e4bd Mon Sep 17 00:00:00 2001 From: Eric Fletcher <64165327+iamericfletcher@users.noreply.github.com> Date: Sat, 2 Apr 2022 12:54:48 -0400 Subject: Migrate Setting Different Statuses to Set Your Bot pin by Python bot to site --- .../setting-different-statuses-on-your-bot.md | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md diff --git a/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md b/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md new file mode 100644 index 00000000..982088a3 --- /dev/null +++ b/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md @@ -0,0 +1,39 @@ +--- +title: Setting Different Statuses to Set Your Bot +description: How to personalize your Discord bot status +--- +**Different Statuses to Set Your Bot:** +```python +# Setting 'Playing' status +await client.change_presence(activity=discord.Game(name="a game")) +``` +```python +# Setting 'Streaming' status +await client.change_presence(activity=discord.Streaming(name="My Stream", url=my_twitch_url)) +``` +```python +# Setting 'Listening' status +await client.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name="a song")) +``` +```python +# Setting 'Watching' status +await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="a movie")) +``` + +**Add Optional Status as Well:** +```python +status=discord.Status. +``` +**Available Statuses:** +```python +do_not_disturb (red icon) +``` +```python +idle (yellow icon) +``` +```python +online (default, green icon) +``` +```python +offline (gray icon) +``` \ No newline at end of file -- cgit v1.2.3 From 63c67a11f219a078c80d1d8e9b6b80cbf6aebbd0 Mon Sep 17 00:00:00 2001 From: Eric Fletcher <64165327+iamericfletcher@users.noreply.github.com> Date: Sat, 2 Apr 2022 13:29:50 -0400 Subject: Adding extra space at end of file in response to failing GH lint check. --- .../guides/python-guides/setting-different-statuses-on-your-bot.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md b/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md index 982088a3..7735f128 100644 --- a/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md +++ b/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md @@ -36,4 +36,4 @@ online (default, green icon) ``` ```python offline (gray icon) -``` \ No newline at end of file +``` -- cgit v1.2.3 From eee7ace0b58be610c7ac00f7f5634d9f73454961 Mon Sep 17 00:00:00 2001 From: Eric Fletcher <64165327+iamericfletcher@users.noreply.github.com> Date: Sat, 2 Apr 2022 12:54:48 -0400 Subject: Migrate Setting Different Statuses to Set Your Bot pin by Python bot to site --- .../setting-different-statuses-on-your-bot.md | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md diff --git a/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md b/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md new file mode 100644 index 00000000..a01ce8da --- /dev/null +++ b/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md @@ -0,0 +1,41 @@ +--- +title: Setting Different Statuses to Set Your Bot +description: How to personalize your Discord bot status +--- + +#### Setting 'Playing' Status +```python +await client.change_presence(activity=discord.Game(name="a game")) +``` + +#### Setting 'Streaming' Status +```python +await client.change_presence(activity=discord.Streaming(name="My Stream", url=my_twitch_url)) +``` + +#### Setting 'Listening' Status +```python +await client.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name="a song")) +``` + +#### Setting 'Watching' Status +```python +await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="a movie")) +``` + +#### Add Optional Status as Well: + +* status=discord.Status.\ + +####Available Statuses: + +* do_not_disturb(red icon) + + +* idle(yellow icon) + + +* online(default, green icon) + + +* offline(gray icon) -- cgit v1.2.3 From c0a15c94861cce9e56eebb6307e09bb3cfd46de3 Mon Sep 17 00:00:00 2001 From: Eric Fletcher <64165327+iamericfletcher@users.noreply.github.com> Date: Sun, 10 Apr 2022 11:31:12 -0400 Subject: Migrate Setting Different Statuses to Set Your Bot pin by Python bot to site --- .../guides/python-guides/setting-different-statuses-on-your-bot.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md b/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md index a01ce8da..53390416 100644 --- a/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md +++ b/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md @@ -2,6 +2,12 @@ title: Setting Different Statuses to Set Your Bot description: How to personalize your Discord bot status --- +**Please note:** + +If you want to change the bot status, it is suggested to not do it during the on_ready event, since it would be called +many times and making an API call on that event has a chance to disconnect the bot. +Instead, set the desired status using the activity / status kwarg of commands.Bot, for example +`bot = commands.Bot(command_prefix="!", activity=..., status=...)` #### Setting 'Playing' Status ```python -- cgit v1.2.3 From 0179ae50cbb49c83eeca4493e14a67e813ef3772 Mon Sep 17 00:00:00 2001 From: Xithrius Date: Sun, 20 Nov 2022 06:11:52 -0800 Subject: Appeased the requests from reviews. --- .../setting-different-statuses-on-your-bot.md | 39 +++++++++++----------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md b/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md index 53390416..b44c55e1 100644 --- a/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md +++ b/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md @@ -1,13 +1,22 @@ --- -title: Setting Different Statuses to Set Your Bot +title: Setting Different Statuses on Your Bot description: How to personalize your Discord bot status --- + +You've probably seen a bot or two have a status message under their username in the member bar set to something such as `Playing Commands: .help`. + +This guide shows how to set such a presence, so your bot can have one as well. + **Please note:** -If you want to change the bot status, it is suggested to not do it during the on_ready event, since it would be called -many times and making an API call on that event has a chance to disconnect the bot. -Instead, set the desired status using the activity / status kwarg of commands.Bot, for example -`bot = commands.Bot(command_prefix="!", activity=..., status=...)` +If you want to change the bot status, it is suggested to not do so during the on_ready event, since it would be called many times and making an API call on that event has a chance to disconnect the bot. + +Instead, set the desired status using the activity / status kwarg of commands.Bot, for example: +```python +bot = commands.Bot(command_prefix="!", activity=..., status=...) +``` + +The following are examples of what you can put into the `activity` keyword argument. #### Setting 'Playing' Status ```python @@ -29,19 +38,9 @@ await client.change_presence(activity=discord.Activity(type=discord.ActivityType await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="a movie")) ``` -#### Add Optional Status as Well: - -* status=discord.Status.\ - -####Available Statuses: - -* do_not_disturb(red icon) - - -* idle(yellow icon) - - -* online(default, green icon) - +### Add Optional Status as Well: -* offline(gray icon) +* `discord.Status.online` (default, green icon) +* `discord.Status.idle` (yellow icon) +* `discord.Status.do_not_disturb` (red icon) +* `discord.Status.offline` (gray icon) -- cgit v1.2.3 From 2889b53d33bd5f4b38e5e28746ee81c252d64be8 Mon Sep 17 00:00:00 2001 From: Xithrius Date: Mon, 12 Dec 2022 02:54:10 -0800 Subject: Confirmation with the reader on when to set status --- .../guides/python-guides/setting-different-statuses-on-your-bot.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md b/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md index b44c55e1..45c7b37c 100644 --- a/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md +++ b/pydis_site/apps/content/resources/guides/python-guides/setting-different-statuses-on-your-bot.md @@ -5,11 +5,13 @@ description: How to personalize your Discord bot status You've probably seen a bot or two have a status message under their username in the member bar set to something such as `Playing Commands: .help`. -This guide shows how to set such a presence, so your bot can have one as well. +This guide shows how to set such a status, so your bot can have one as well. **Please note:** -If you want to change the bot status, it is suggested to not do so during the on_ready event, since it would be called many times and making an API call on that event has a chance to disconnect the bot. +If you want to change the bot status, it is suggested to not do so during the `on_ready` event, since it would be called many times and making an API call on that event has a chance to disconnect the bot. + +The status should not have a problem being set during runtime with `change_presence`, in the examples shown below. Instead, set the desired status using the activity / status kwarg of commands.Bot, for example: ```python -- cgit v1.2.3