aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/content/resources/guides
diff options
context:
space:
mode:
authorGravatar RohanJnr <[email protected]>2023-05-17 00:58:11 +0530
committerGravatar RohanJnr <[email protected]>2023-05-17 00:58:11 +0530
commit9b0e2711f15ed2e1aa5c080a716b0e9f1691dbd6 (patch)
treee6a85262510d923ecdbb348fffa483b3b51a31c8 /pydis_site/apps/content/resources/guides
parentuse launch_time attribute in the example method and command (diff)
correct return type annotation for get_launch_time_str function
Diffstat (limited to 'pydis_site/apps/content/resources/guides')
-rw-r--r--pydis_site/apps/content/resources/guides/python-guides/subclassing_bot.md3
1 files changed, 2 insertions, 1 deletions
diff --git a/pydis_site/apps/content/resources/guides/python-guides/subclassing_bot.md b/pydis_site/apps/content/resources/guides/python-guides/subclassing_bot.md
index 47186e3d..1be6e485 100644
--- a/pydis_site/apps/content/resources/guides/python-guides/subclassing_bot.md
+++ b/pydis_site/apps/content/resources/guides/python-guides/subclassing_bot.md
@@ -27,7 +27,7 @@ class CustomBot(commands.Bot):
await super().start(*args, **kwargs)
# Example of a custom bot method
- def get_launch_time_str(self) -> datetime.datetime:
+ def get_launch_time_str(self) -> str:
"""Get bot launch datetime without milliseconds in UTC and status."""
return f"Bot started at: {self.launch_time.strftime('%F %T')} UTC."
@@ -56,3 +56,4 @@ token = YOUR_TOKEN_HERE
bot.run(token)
```
With the above example, you are not required to change any of the existing or future code, it is identical to code done without subclassing bot.
+ty \ No newline at end of file