-
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.
- Loading branch information
1 parent
7073df3
commit 8075f61
Showing
8 changed files
with
120 additions
and
15 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
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,13 +1,4 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
# vidya - A Discord bot to play quizzes and learn with fun. | ||
# Copyright (C) 2021 Shubhendra Kushwaha | ||
# Email: [email protected] | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as published | ||
# by the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# This program is distributed in the hope that it will be useful, | ||
# distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
|
@@ -19,7 +10,7 @@ | |
Cog, | ||
Context, | ||
command, | ||
) | ||
) | ||
|
||
|
||
class Currency(Cog): | ||
|
@@ -30,6 +21,7 @@ def __init__(self, bot): | |
|
||
@command() | ||
async def daily(self, ctx: Context): | ||
"""Earn Daily Reward.""" | ||
ttl = await self.redis.ttl( | ||
f"daily:{ctx.author.id}", | ||
) | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
# vidya - A Discord bot to play quizzes and learn with fun. | ||
# Copyright (C) 2021 Shubhendra Kushwaha | ||
# Email: [email protected] | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as published | ||
# by the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
|
||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
from typing import Dict, List | ||
from discord.ext.commands import ( | ||
Command, | ||
Cog, | ||
HelpCommand, | ||
) | ||
|
||
Mapping = Dict[Cog, List[Command]] | ||
|
||
|
||
class VidyaHelpCommand(HelpCommand): | ||
"""Custom help command.""" | ||
|
||
def __init__(self): | ||
super().__init__() | ||
|
||
async def send_bot_help( | ||
self, | ||
mapping: Mapping, | ||
): | ||
"""Method to send help for all commands.""" | ||
embed = self.context.bot.embed.bot_help(mapping) | ||
await self.context.send(embed=embed) | ||
|
||
async def send_command_help(self, command: Command): | ||
"""Method to send help for a specific command.""" | ||
destination = self.get_destination() | ||
await destination.send(embed=self.context.bot.embed.command_help(command)) |
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