-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
65 lines (43 loc) · 1.33 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import discord
from discord.ext import commands
import os
import asyncio
import bot_functions as bot
from dotenv import load_dotenv
load_dotenv()
intents = discord.Intents.default()
intents.members = True
client = commands.Bot(command_prefix="$", intents=intents)
@client.event
async def on_ready():
print(f"We have logged in as {client.user.id}")
@client.event
async def on_message(message):
await client.process_commands(message)
@client.command()
async def owo(ctx):
await ctx.send("owo")
@client.command()
async def hello(ctx):
await ctx.send("World!")
@client.command()
async def shutdown(ctx):
await ctx.send("Shutting down!")
await client.close()
@client.command()
async def msg(ctx, *, mentions):
members_msg = bot.get_mentions(ctx)
if not members_msg:
await ctx.reply("Mention someone nerd.")
return
await ctx.reply("What is your message?")
def get_msg(message):
return message.author == ctx.author and message.channel == ctx.channel
try:
msg = await client.wait_for('message', timeout=20.0, check=get_msg)
except asyncio.TimeoutError:
await ctx.reply('Bro enter a message or practice your typing speed.')
return
await bot.dm(ctx, members_msg, msg)
if __name__ == "__main__":
client.run(os.getenv("TOKEN"))