it is working :'D
This commit is contained in:
parent
d8fdd74316
commit
6b81c4d8d0
40
bot.py
40
bot.py
|
|
@ -1,6 +1,7 @@
|
|||
import os
|
||||
import discord
|
||||
from dotenv import load_dotenv
|
||||
from discord.ext import commands
|
||||
|
||||
|
||||
def checkEnv():
|
||||
|
|
@ -22,36 +23,41 @@ checkEnv()
|
|||
|
||||
load_dotenv("token.env")
|
||||
TOKEN = os.getenv('DISCORD_TOKEN')
|
||||
GUILD = os.getenv('DISCORD_GUILD')
|
||||
ZENEID = os.getenv('ZENEKOMMAND_ID')
|
||||
YEPID = os.getenv('YEP_ID')
|
||||
# GUILD = os.getenv('DISCORD_GUILD')
|
||||
# ZENEID = os.getenv('ZENEKOMMAND_ID')
|
||||
# YEPID = os.getenv('YEP_ID')
|
||||
|
||||
client = discord.Client()
|
||||
client = commands.Bot(command_prefix='!')
|
||||
|
||||
@client.event
|
||||
async def on_message(message):
|
||||
if message.author == client.user:
|
||||
return
|
||||
|
||||
server = message.guild
|
||||
channel = discord.utils.get(server.channels, name=message.channel.name)
|
||||
print(channel.id)
|
||||
channel_zene = client.get_channel(733950770927370250)
|
||||
channel_yep = client.get_channel(733950633291546686)
|
||||
|
||||
if str(message.author) == 'Rythm#3722':
|
||||
return
|
||||
# if str(message.author) == 'Rythm#3722':
|
||||
# return
|
||||
|
||||
print(message.author)
|
||||
|
||||
if str(channel_zene) == str(message.channel) and not(message.content.startswith('!')):
|
||||
print(f"{channel_zene} , {message.channel}")
|
||||
await message.channel.send('Kérlek ebbe a szobába csak a Rythm botnak adj parancsokat. Köszönöm!')
|
||||
await message.delete()
|
||||
if message.author == 'Rythm':
|
||||
message.delete()
|
||||
|
||||
if str(channel_zene) != str(message.channel) and (message.content.startswith('!')):
|
||||
print(f"{channel_zene} , {message.channel}")
|
||||
await message.channel.send('Ez nem a zene-kommand szoba, ide kérlek ne írj parancsokat a Rythm botnak. Köszönöm!')
|
||||
await message.delete()
|
||||
if not str(message.author) == 'Rythm#3722':
|
||||
if str(channel_zene) == str(message.channel) and not(message.content.startswith('!')):
|
||||
print(f"{channel_zene} , {message.channel}")
|
||||
await message.channel.send('Kérlek ebbe a szobába csak a Rythm botnak adj parancsokat. Köszönöm!')
|
||||
await message.delete()
|
||||
if message.author == 'Rythm':
|
||||
message.delete()
|
||||
|
||||
if str(channel_zene) != str(message.channel) and (message.content.startswith('!')):
|
||||
print(f"{channel_zene} , {message.channel}")
|
||||
await message.channel.send('Ez nem a zene-kommand szoba, ide kérlek ne írj parancsokat a Rythm botnak. Köszönöm!')
|
||||
await message.delete()
|
||||
await message.channel.send('!disconnect')
|
||||
|
||||
# if str(channel_yep) == str(message.channel) and message.author == 'Rythm':
|
||||
# message.delete()
|
||||
|
|
|
|||
Loading…
Reference in New Issue