This repository has been archived on 2020-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
robo-rat/bot.py

54 lines
1.6 KiB
Python

import logging
import os
import discord
from discord.ext import commands
import datetime
logging.basicConfig(level=logging.INFO, style='{', datefmt="%d.%m.%Y %H:%M:%S",
format="{asctime} - {levelname} - {name} - {message}")
bot = commands.Bot(description="🧀 Accepting Cheese!!! 🧀", command_prefix='&')
@bot.command(pass_context=True)
async def load(ctx, module):
if ctx.message.author.id == '140652945032216576':
bot.load_extension(module)
await bot.say('{} loaded'.format(module))
@bot.command(pass_context=True)
async def unload(ctx, module):
if ctx.message.author.id == '140652945032216576':
bot.unload_extension(module)
await bot.say('{} unloaded'.format(module))
@bot.command(pass_context=True)
async def reload(ctx, module):
if ctx.message.author.id == '140652945032216576':
bot.load_extension(module)
bot.unload_extension(module)
await bot.say('{} reloaded'.format(module))
@bot.event
async def on_ready():
bot.load_extension("repl")
bot.load_extension("runescape")
bot.load_extension("dogs")
bot.load_extension("bot_commands")
bot.load_extension('discordinfo')
await bot.change_presence(game=discord.Game(name='CHEESE', type=2))
await bot.send_message(discord.Object(id="408902143119196161"),
"**Im ready!** " + str(datetime.datetime.now()))
@bot.event
async def on_message(message):
if message.server.get_member('140652945032216576') in message.mentions:
await bot.add_reaction(message, '🐀')
await bot.process_commands(message)
bot.run(os.getenv('TOKEN'))