nonexistent commands wont raise exception anymore; suggestionChannel is added in serverconfig
This commit is contained in:
parent
5dcec89eff
commit
a4ae8fd6b8
9
akuma.py
9
akuma.py
@ -1,5 +1,6 @@
|
|||||||
import json, discord
|
import json, discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
|
from discord.ext.commands import CommandNotFound
|
||||||
|
|
||||||
#config files
|
#config files
|
||||||
cFile = "settings.json"
|
cFile = "settings.json"
|
||||||
@ -26,7 +27,7 @@ async def on_ready():
|
|||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
async def on_guild_join(guild):
|
async def on_guild_join(guild):
|
||||||
s[str(guild.id)] = {"adminRole": "", "modRole": "", "joinMessage" : "", "suggestionChannel": 0, "modChannel": 0}
|
s[str(guild.id)] = {"adminRole": "", "modRole": "", "joinMessage" : "", "suggestionChannel": 0, "modChannel": 0, "announcementChannel": 0}
|
||||||
writeServer(s)
|
writeServer(s)
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
@ -34,6 +35,12 @@ async def on_guild_remove(guild):
|
|||||||
del s[str(guild.id)]
|
del s[str(guild.id)]
|
||||||
writeServer(s)
|
writeServer(s)
|
||||||
|
|
||||||
|
@bot.event
|
||||||
|
async def on_command_error(ctx, error):
|
||||||
|
if isinstance(error, CommandNotFound):
|
||||||
|
return
|
||||||
|
raise error
|
||||||
|
|
||||||
@bot.command(hidden=True)
|
@bot.command(hidden=True)
|
||||||
async def printExt(ctx):
|
async def printExt(ctx):
|
||||||
"""Prints out every loaded extension"""
|
"""Prints out every loaded extension"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user