-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.py
40 lines (28 loc) · 952 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from discord.ext.commands import Bot,CommandNotFound
from discord.ext.commands.context import Context
from app.managecommands import get_captcha, receive_captcha
from json import load
bot:Bot = Bot(command_prefix="$",)
with open("settings.json", "r") as config:
token = load(config)["token"]
@bot.command(name="getCaptcha")
async def output(ctx):
if len(ctx.author.roles)>0:
await ctx.send("mal parido , ya tienes un role")
return
await get_captcha(ctx)
@bot.command(name="verify")
async def output(ctx:Context, arg=None):
if len(ctx.author.roles)>0:
await ctx.send("mal parido , ya tienes un role")
return
if not arg:
await ctx.send("mal parido te falto un argumento")
return
await receive_captcha(ctx, arg)
@bot.event
async def on_command_error(_:Context, error):
if isinstance(error, CommandNotFound):
return
raise error
bot.run(token)