Botinvite Message

This commit is contained in:
Akumatic 2018-06-20 21:03:48 +02:00
parent 750e021833
commit c0bc979330
2 changed files with 17 additions and 12 deletions

View File

@ -2,19 +2,22 @@ import json
import discord
from discord.ext import commands
#config file
c = json.load(open("settings.json", "r"))
s = json.load(open("server.json", "r"))
#The Bot itself
bot = commands.Bot(description=c["description"], command_prefix=c["prefix"])
cFile = "settings.json"
sFile = "server.json"
#config file
c = json.load(open(cFile, "r"))
s = json.load(open(sFile, "r"))
#Function to write changed config to JSON file
def writeConfig(data):
json.dump(data, open("settings.json", "w"), indent=4)
json.dump(data, open(cFile, "w"), indent=4)
def writeServer(data):
json.dump(data, open("server.json", "w"), indent=4)
json.dump(data, open(sFile, "w"), indent=4)
#The Bot itself
bot = commands.Bot(description=c["description"], command_prefix=c["prefix"])
@bot.event
async def on_ready():
@ -32,10 +35,6 @@ async def on_guild_remove(guild):
del s[str(guild.id)]
writeServer(s)
@bot.command()
async def invite(ctx):
await ctx.send("https://discordapp.com/oauth2/authorize?client_id={}&scope=bot&permissions=8".format(bot.user.id))
@bot.command(hidden=True)
async def printExt(ctx):
"""Prints out every loaded extension"""

View File

@ -11,6 +11,12 @@ class User():
"""Prints the greeting text a user receives by joining the server"""
await ctx.send(s[str(ctx.guild.id)]["joinMessage"])
@commands.command()
async def botinvite(self, ctx):
await ctx.send("""Invite Link: <https://discordapp.com/oauth2/authorize?client_id={}&scope=bot&permissions=8>
\nPlease read <https://github.com/Akumatic/Akuma-Matata/blob/master/README.md> for informations""".format(self.bot.user.id))
@commands.command()
async def suggest(self, ctx, *, msg : str):
"""Makes a suggestion to the moderation team.