diff --git a/.gitignore b/.gitignore index 9b51d74..6108169 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +Config.json +PrivateConfig.json + # Byte-compiled / optimized / DLL files # Recurse @@ -108,8 +111,7 @@ venv.bak/ # mypy .mypy_cache/ -src/config/Config.json -PrivateConfig.json + # Ignore dockerfiles docker-compose.yml diff --git a/requirements.txt b/requirements.txt index 0927ad0..501e963 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,10 @@ yarl<1.2 numpy==1.14.0 -uvloop +aiofiles +# aiomultiprocess +# aiosqlite +# asyncpg +# dataclasses +# cached_property +uvloop==0.9.1 +aiohttp==3.2.1 \ No newline at end of file diff --git a/src/__main__.py b/src/__main__.py index 824e5ec..d418558 100644 --- a/src/__main__.py +++ b/src/__main__.py @@ -63,7 +63,7 @@ class SebiMachine(commands.Bot, LoadConfig, Loggable): cog = cog.replace('\n', '') self.load_extension(f'src.cogs.{cog}') self.logger.info(f'Loaded: {cog}') - + async def on_ready(self): """On ready function""" self.maintenance and self.logger.warning('MAINTENANCE ACTIVE') diff --git a/src/cogs.txt b/src/cogs.txt index cf9f9a2..4945aed 100644 --- a/src/cogs.txt +++ b/src/cogs.txt @@ -4,3 +4,4 @@ tag code git fun +moderation diff --git a/src/cogs/contributors.py b/src/cogs/contributors.py index 4a888a6..69aca0a 100644 --- a/src/cogs/contributors.py +++ b/src/cogs/contributors.py @@ -1,5 +1,5 @@ #!/usr/bin/python -# -*- coding: -*- +# -*- coding: utf-8 -*- from discord.ext import commands import discord @@ -81,29 +81,5 @@ class Upload: else: await ctx.send(f'Loaded `{extension}`.') - @commands.command() - async def kick(self, ctx, member: discord.Member = None): - """ - Kick a discord member from your server. - Only contributors can use this command - - Usage: - - kick - - """ - await ctx.trigger_typing() - if ctx.author.id not in self.bot.ownerlist: - return await ctx.send('Only my contributors can use me like this :blush:', delete_after=10) - - if member is None: - await ctx.send('Are you sure you are capable of this command?') - try: - await member.kick() - await ctx.send(f'You kicked **`{member.name}`** from **`{ctx.guild.name}`**') - - except Exception as e: - await ctx.send('You may not use this command you do not have permission in server:\n\n**`{ctx.guild.name}`**' - f'\n\n```py\n{e}\n```') - def setup(bot): bot.add_cog(Upload(bot)) \ No newline at end of file diff --git a/src/cogs/example.py b/src/cogs/example.py index 4a73cbc..0376923 100644 --- a/src/cogs/example.py +++ b/src/cogs/example.py @@ -1,5 +1,5 @@ #!/usr/bin/python -# -*- coding: -*- +# -*- coding: utf-8 -*- from discord.ext import commands import discord diff --git a/src/cogs/fun.py b/src/cogs/fun.py index d066435..ec56b83 100644 --- a/src/cogs/fun.py +++ b/src/cogs/fun.py @@ -1,5 +1,5 @@ #!/usr/bin/python -# -*- coding: -*- +# -*- coding: utf-8 -*- from discord.ext import commands import discord diff --git a/src/cogs/git.py b/src/cogs/git.py index 06645f6..2be5354 100644 --- a/src/cogs/git.py +++ b/src/cogs/git.py @@ -41,7 +41,7 @@ class Git(Loggable): @commands.group(case_insensitive=True, invoke_without_command=True) async def git(self, ctx): """Run help git for more info""" - await ctx.send('https://github.com/Annihilator708/Sebi-Machine/') + await ctx.send('https://github.com/dustinpianalto/Sebi-Machine/') @commands.command(case_insensitive=True, brief='Gets the Trello link.') async def trello(self, ctx): diff --git a/src/cogs/moderation.py b/src/cogs/moderation.py new file mode 100644 index 0000000..df0fb22 --- /dev/null +++ b/src/cogs/moderation.py @@ -0,0 +1,44 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +from discord.ext import commands +import discord + +class Moderation: + """ + Moderation Commands + """ + def __init__(self, bot): + self.bot = bot + + @commands.command() + async def sar(self, ctx): + """Assign or remove self assigned roles.""" + pass + + @commands.command() + async def kick(self, ctx, member: discord.Member = None): + """ + Kick a discord member from your server. + Only contributors can use this command. + + Usage: + - kick + + """ + await ctx.trigger_typing() + if ctx.author.id not in self.bot.ownerlist: + return await ctx.send('Only my contributors can use me like this :blush:', delete_after=10) + + if member is None: + await ctx.send('Are you sure you are capable of this command?') + try: + await member.kick() + await ctx.send(f'You kicked **`{member.name}`** from **`{ctx.guild.name}`**') + + except Exception as e: + await ctx.send('You may not use this command you do not have permission in server:\n\n**`{ctx.guild.name}`**' + f'\n\n```py\n{e}\n```') + +def setup(bot): + bot.add_cog(Moderation(bot)) diff --git a/src/cogs/sar.js b/src/cogs/sar.js index 4d158cb..7cc25d4 100644 --- a/src/cogs/sar.js +++ b/src/cogs/sar.js @@ -19,14 +19,15 @@ exports.run = async function(client, message, args) { const type = args[0]; // can be get, remove or list - if (type == "list") { + if (type == "list" || type == undefined) { const embed = new Discord.RichEmbed() .setTitle("List of Self Assigned Roles") .setDescription("Usage: `S!sar [ get | remove | list ] [ number ]`") - .addField("1. Heroku Helper", "S!sar get 2", true) - .addField("2. JS Helper", "S!sar get 3", true) - .addField("3. Rewrite Helper", "S!sar get 4", true); + .addField("1. Heroku Helper", "S!sar get 1", true) + .addField("2. JS Helper", "S!sar get 2", true) + .addField("3. Rewrite Helper", "S!sar get 3", true) + .setColor("AQUA"); return message.channel.send({ embed: embed @@ -49,10 +50,12 @@ exports.run = async function(client, message, args) { case "get": message.member.addRole(roles[choice]); + message.channel.send("Added the role you specified!"); // confirmation message break; case "remove": message.member.removeRole(roles[choice]); + message.channel.send("Removed the role you specified!"); // confirmation message break; default: @@ -61,6 +64,4 @@ exports.run = async function(client, message, args) { } - message.channel.send("Added the role you wanted!"); // confirmation message - } \ No newline at end of file diff --git a/src/config/Config.json b/src/config/Config.json deleted file mode 100644 index a301982..0000000 --- a/src/config/Config.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "version": 0.1, - "display_name" : "[ds!] Dev-Sebi", - "maintenance": "True", - "ownerlist": [387871282756190208, 275280442884751360, 351794468870946827, 140652945032216576], - "prefix": "ds!", - "dbconnect": "" -} diff --git a/src/config/PrivateConfig.json b/src/config/PrivateConfig.json deleted file mode 100644 index 9fa108b..0000000 --- a/src/config/PrivateConfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "bot-key": "" -} \ No newline at end of file