mirror of
https://github.com/TotalFreedomMC/TotalFreedomBot.git
synced 2024-12-22 15:44:57 +00:00
Update main.py
This commit is contained in:
parent
39539cff2b
commit
8c29037909
1 changed files with 5 additions and 4 deletions
9
main.py
9
main.py
|
@ -17,8 +17,7 @@ load_dotenv()
|
||||||
botToken = os.getenv('botToken')
|
botToken = os.getenv('botToken')
|
||||||
|
|
||||||
intents = discord.Intents.all()
|
intents = discord.Intents.all()
|
||||||
bot = commands.Bot(command_prefix=os.getenv('prefix'),
|
bot = commands.Bot(command_prefix=get_prefix, case_insensitive=True, description='TotalFreedom bot help command', intents=intents)
|
||||||
description='TotalFreedom bot help command', intents=intents)
|
|
||||||
|
|
||||||
|
|
||||||
extensions = [
|
extensions = [
|
||||||
|
@ -42,6 +41,9 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
async def on_message(message):
|
async def on_message(message):
|
||||||
|
if isinstance(message.channel, discord.channel.DMChannel):
|
||||||
|
print(f'{message.author} DM: {message.content}')
|
||||||
|
return
|
||||||
if message.guild and message.author is message.guild.me and message.channel.id == reports_channel_id:
|
if message.guild and message.author is message.guild.me and message.channel.id == reports_channel_id:
|
||||||
await message.add_reaction(clipboard)
|
await message.add_reaction(clipboard)
|
||||||
if message.type == discord.MessageType.new_member:
|
if message.type == discord.MessageType.new_member:
|
||||||
|
@ -71,7 +73,6 @@ async def on_message(message):
|
||||||
await message.delete()
|
await message.delete()
|
||||||
await message.channel.send(f"{message.author.mention} do not post invite links to other discord servers.")
|
await message.channel.send(f"{message.author.mention} do not post invite links to other discord servers.")
|
||||||
|
|
||||||
if message.content.lower().startswith(os.getenv('prefix')):
|
await bot.process_commands(message)
|
||||||
await bot.process_commands(message)
|
|
||||||
|
|
||||||
bot.run(botToken)
|
bot.run(botToken)
|
||||||
|
|
Loading…
Reference in a new issue