-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.py
45 lines (28 loc) · 929 Bytes
/
bot.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
import discord
from discord.ext import commands
from music_cog import music_cog
Bot = commands.Bot(command_prefix="/")
Bot.add_cog(music_cog(Bot))
@Bot.command()
async def scrie(ctx, *args):
m_args = " ".join(args)
await ctx.send(m_args)
@Bot.listen()
async def on_message(message):
if message.author == Bot.user:
return
if message.content.startswith("$salut"):
await message.channel.send("hey, boss!")
@Bot.listen()
async def on_message(message):
if message.content.startswith("$greet"):
channel = message.channel
await channel.send("Say hello!")
def check(m):
return m.content == "hello" and m.channel == channel
msg = await Bot.wait_for("message", check=check)
await channel.send("Hello {.author} on channel {.channel}!".format(msg, msg))
token = ""
with open("token.txt") as file:
token = file.read()
Bot.run(token)