-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added $wait, $for, $botInfo and $uptime
- Loading branch information
Showing
7 changed files
with
199 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from . import bot_info | ||
from . import channel_info | ||
from . import guild_info | ||
from . import role_info | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import disnake | ||
from disnake.ext import commands | ||
|
||
from ...functions_handler import FunctionsHandler | ||
|
||
|
||
class BotInfo(FunctionsHandler): | ||
def __init__(self, handler): | ||
super().__init__() | ||
self.handler = handler | ||
self.bot: commands.InteractionBot = handler.client.bot | ||
|
||
async def func_botinfo(self, ctx: disnake.Message, args: str): | ||
""" | ||
`$botInfo[param]` | ||
### Example: | ||
`$botInfo[name]` | ||
### Example 2: | ||
`$botInfo[id]` | ||
""" | ||
args_list = await self.get_args(await self.is_have_functions(args, ctx), ctx) | ||
if len(args_list) != 1: | ||
raise ValueError("$botInfo: Too many or no args provided") | ||
|
||
info = await self.bot.application_info() | ||
params = { | ||
"is_private": info.bot_public, | ||
"image": info.cover_image if info.cover_image else "", | ||
"description": info.description, | ||
"icon": info.icon.url if info.icon else "", | ||
"id": info.id, | ||
"owner": info.owner.id, | ||
"guilds": len(self.bot.guilds), | ||
"users": len([j for i in self.bot.guilds for j in i.members]) | ||
} | ||
|
||
return str(params[args_list[0]]) | ||
|
||
def setup(handler): | ||
return BotInfo(handler) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters