2019-04-08 21:30:51 -05:00
|
|
|
# Discord Bot Rewrite V2.2
|
|
|
|
# https://discordpy.readthedocs.io/en/rewrite/
|
|
|
|
|
|
|
|
from discord.ext.commands import Bot
|
2019-04-19 23:48:02 -05:00
|
|
|
import numpy as np
|
2019-04-08 21:30:51 -05:00
|
|
|
|
2019-04-19 22:18:49 -05:00
|
|
|
cogs = ["Modules.raidAutomod.automod"]
|
2019-04-08 21:30:51 -05:00
|
|
|
prefix = 'o!'
|
2019-04-19 23:48:02 -05:00
|
|
|
|
|
|
|
tokens = open("tokens.txt", 'r')
|
|
|
|
tokens = tokens.readlines()
|
|
|
|
bot_running = input("Would you like to run the test bot[T] or the default[D] :: ")
|
|
|
|
if bot_running == 'T':
|
|
|
|
token = tokens[0].rstrip()
|
|
|
|
elif bot_running == 'D':
|
|
|
|
token = tokens[1].rstrip()
|
|
|
|
tokens = ''
|
|
|
|
|
2019-04-08 21:30:51 -05:00
|
|
|
client = Bot(command_prefix=prefix)
|
|
|
|
client.remove_command("help")
|
|
|
|
|
2019-04-08 21:40:38 -05:00
|
|
|
|
2019-04-08 21:30:51 -05:00
|
|
|
@client.event
|
|
|
|
async def on_message(message):
|
|
|
|
if client.get_channel(message.channel.id) == client.get_channel(507386320604102696): # ouat auto mod
|
|
|
|
letter_number = 0
|
|
|
|
number_of_periods = 0
|
|
|
|
place_of_period = 0
|
|
|
|
for letter in message.content:
|
|
|
|
letter_number += 1
|
|
|
|
if letter == '.':
|
|
|
|
number_of_periods += 1
|
|
|
|
place_of_period = letter_number
|
|
|
|
if number_of_periods > 1 or not(place_of_period == len(message.content)) or number_of_periods == 0:
|
|
|
|
await message.delete()
|
|
|
|
|
|
|
|
elif client.get_channel(message.channel.id) == client.get_channel(492089451476942848): # ows auto mod
|
|
|
|
words = message.content.split(' ')
|
|
|
|
if len(words) > 1:
|
|
|
|
await message.delete()
|
|
|
|
await client.process_commands(message)
|
|
|
|
|
|
|
|
|
|
|
|
@client.event
|
|
|
|
async def on_ready():
|
|
|
|
print('Logged in as:')
|
|
|
|
print('{0.user}'.format(client))
|
|
|
|
for cog in cogs:
|
|
|
|
client.load_extension(cog)
|
|
|
|
|
|
|
|
client.run(token)
|