Browse Source

Just some small changes. Fucking error checks are annoying for NSFW. Since you can't error handle commands. So someone inputting shitty commands raises and error you can't catch. Ffs

tags/v1.0.0
roxie 6 years ago
parent
commit
c0e87f2d18
3 changed files with 10 additions and 5 deletions
  1. +1
    -0
      cogs/nsfw.py
  2. +2
    -1
      config/meta.py
  3. +7
    -4
      main.py

+ 1
- 0
cogs/nsfw.py View File

import random import random
from json import JSONDecodeError
import checks import checks
import requests import requests
from discord.ext.commands import bot from discord.ext.commands import bot

+ 2
- 1
config/meta.py View File

__description__ = """RoxBot, A Discord Bot made by a filthy Mercy Main. Built with love (and discord.py) by Roxxers#7443. __description__ = """RoxBot, A Discord Bot made by a filthy Mercy Main. Built with love (and discord.py) by Roxxers#7443.


[Github link](https://github.com/RainbowDinoaur/roxbot)"""
[Github link](https://github.com/RainbowDinoaur/roxbot)
[Changelog](https://github.com/RainbowDinoaur/roxbot#v100)"""
__author__ = "Roxanne Gibson" __author__ = "Roxanne Gibson"
__version__= "1.0" __version__= "1.0"
embedcolour = 0xDEADBF embedcolour = 0xDEADBF

+ 7
- 4
main.py View File

import os.path import os.path
import datetime import datetime
import traceback import traceback
import json


import discord import discord
from discord.ext import commands from discord.ext import commands


server_config = ServerConfig() server_config = ServerConfig()
bot = commands.Bot(command_prefix=load_config.command_prefix, description=load_config.description) bot = commands.Bot(command_prefix=load_config.command_prefix, description=load_config.description)
bot.dev = True # For debugging
bot.dev = False # For debugging
bot.owner = load_config.owner bot.owner = load_config.owner


def blacklisted(user): def blacklisted(user):
await bot.send_message(ctx.message.channel, content="This command is disabled.") await bot.send_message(ctx.message.channel, content="This command is disabled.")
elif isinstance(error, commands.CheckFailure): elif isinstance(error, commands.CheckFailure):
await bot.send_message(ctx.message.channel, content="You do not have permission to do this. Back off, thot!") await bot.send_message(ctx.message.channel, content="You do not have permission to do this. Back off, thot!")
elif isinstance(error, json.JSONDecodeError): # For the NSFW cogs requests because error exception doesn't work in commands because of this here.
await bot.send_message(ctx.message.channel, content="That didn't return anything")
elif isinstance(error, commands.CommandInvokeError): elif isinstance(error, commands.CommandInvokeError):
if bot.dev: if bot.dev:
raise error raise error
await bot.send_message(load_config.owner, embed=embed) await bot.send_message(load_config.owner, embed=embed)
except: except:
raise error raise error
else:
if bot.dev:
raise error
#else:
# if bot.dev:
# raise error


@bot.command(pass_context=True) @bot.command(pass_context=True)
async def about(ctx): async def about(ctx):

Loading…
Cancel
Save