sourcecode command

This commit is contained in:
louis chauvet 2018-09-20 00:18:53 +02:00
parent 6cc4f8fcdc
commit ccea8e224c
2 changed files with 31 additions and 0 deletions

18
modules/github.py Normal file
View File

@ -0,0 +1,18 @@
import discord
import traductions as tr
class MainClass:
name = "github"
def __init__(self, guild):
self.guild = guild
async def sourcecode(self,msg, command, args):
await msg.channel.send(tr.tr[self.guild.config["lang"]]["modules"]["github"]["sourcecode"])
async def on_message(self, msg):
if msg.content.startswith(self.guild.config["prefix"]):
command, *args = msg.content.lstrip(self.guild.config["prefix"]).split(" ")
if command == "sourcecode":
await self.sourcecode(msg, command, args)
return

View File

@ -119,6 +119,19 @@ tr = {
},
"pi": "Voici les 2000 décimales de pi que vous avez demandé (à partir de la {debut}ème):",
},
"github": {
"description": "Commands relatives à discord",
"help": {
"sourcecode": {
"description": "Donne un lien vers mon code source (il est là comme ca tu a pas retapper la \
commande :smile: https://github.com/Fomys/foBot",
"examples":[
("`prefix`sourcecode", "Affiche mon code source")
]
},
},
"sourcecode":"Mon code source est disponible sur github: https://github.com/Fomys/foBot",
},
"tools": {
"description": "Commandes utiles",
"help": {