aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bot.py2
-rw-r--r--cogs/admin.py38
-rw-r--r--cogs/general.py1
-rw-r--r--cogs/help.py16
-rw-r--r--cogs/player.py5
-rw-r--r--cogs/utils.py4
-rw-r--r--custom_commands.json2
7 files changed, 59 insertions, 9 deletions
diff --git a/bot.py b/bot.py
index 592b9b1..7a1990c 100644
--- a/bot.py
+++ b/bot.py
@@ -18,7 +18,7 @@ extensions = [
def get_prefix(bot, message):
"""A callable Prefix for our bot. This could be edited to allow per server prefixes."""
- prefixes = ['/', '!', 'steve ', 'Steve ', 'STEVE ', '@']
+ prefixes = ['steve ', 'STEVE ', '/', '!', '@','Steve ']
# Check to see if we are outside of a guild. e.g DM's etc.
#if not message.guild:
diff --git a/cogs/admin.py b/cogs/admin.py
index 670ab34..f252944 100644
--- a/cogs/admin.py
+++ b/cogs/admin.py
@@ -1,5 +1,6 @@
from discord.ext import commands
import discord
+import asyncio
import subprocess
import json
import git
@@ -100,7 +101,42 @@ class Admin(commands.Cog):
@commands.command()
@commands.check(is_mod)
async def clear(self, ctx, number):
- await ctx.message.channel.purge(limit=int(number), check=None, before=None, after=None, around=None, oldest_first=False, bulk=True)
+ await ctx.message.channel.purge(limit=int(number)+1, check=None, before=None, after=None, around=None, oldest_first=False, bulk=True)
+
+ @commands.check(is_mod)
+ @commands.command()
+ async def mute(self, ctx, members: commands.Greedy[discord.Member],
+ mute_minutes: int = 0,
+ *, reason: str = "absolutely no reason"):
+ """Mass mute members with an optional mute_minutes parameter to time it"""
+
+ if not members:
+ await ctx.send("You need to name someone to mute")
+ return
+
+ #muted_role = discord.utils.find(ctx.guild.roles, name="Muted")
+ muted_role = ctx.guild.get_role(707707894694412371)
+ for member in members:
+ if self.bot.user == member: # what good is a muted bot?
+ embed = discord.Embed(title = "You can't mute me, I'm an almighty bot")
+ await ctx.send(embed = embed)
+ continue
+ await member.add_roles(muted_role, reason = reason)
+ await ctx.send("{0.mention} has been muted by {1.mention} for *{2}*".format(member, ctx.author, reason))
+
+ if mute_minutes > 0:
+ await asyncio.sleep(mute_minutes * 60)
+ for member in members:
+ await member.remove_roles(muted_role, reason = "time's up ")
+
+ @commands.check(is_mod)
+ @commands.command()
+ async def unmute(self, ctx, members: commands.Greedy[discord.Member]):
+ muted_role = ctx.guild.get_role(707707894694412371)
+ for i in members:
+ await i.remove_roles(muted_role)
+ await ctx.send("{0.mention} has been unmuted by {1.mention}".format(i, ctx.author))
+
def setup(bot):
diff --git a/cogs/general.py b/cogs/general.py
index 9dc2f18..091c325 100644
--- a/cogs/general.py
+++ b/cogs/general.py
@@ -2,7 +2,6 @@ from discord.ext import commands
import discord
import datetime
-
def dump(obj):
output = ""
for attr in dir(obj):
diff --git a/cogs/help.py b/cogs/help.py
index ac330f1..91c9c45 100644
--- a/cogs/help.py
+++ b/cogs/help.py
@@ -1,5 +1,10 @@
from discord.ext import commands
from random import randint
+import os, sys, inspect
+current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
+parent_dir = os.path.dirname(current_dir)
+sys.path.insert(0, parent_dir)
+import bot
class MyHelpCommand(commands.MinimalHelpCommand):
messages = [
@@ -374,6 +379,17 @@ class Help(commands.Cog):
def cog_unload(self):
self.bot.help_command = self._original_help_command
+ @commands.command()
+ async def prefix(self, ctx):
+ prefixes = bot.get_prefix(self.bot, ctx.message)
+ prefixes.pop(1)
+ prefixes.pop(1)
+ prefixes.pop(1)
+ output = ""
+ for i in prefixes:
+ output += i+", "
+
+ await ctx.send(f"My prefixes are {output}")
def setup(bot):
bot.add_cog(Help(bot))
diff --git a/cogs/player.py b/cogs/player.py
index c977838..d7d2302 100644
--- a/cogs/player.py
+++ b/cogs/player.py
@@ -75,8 +75,6 @@ class Player(commands.Cog):
return await ctx.voice_client.move_to(channel)
await channel.connect()
-
- @commands.check(is_in_vc)
@commands.command()
async def play(self, ctx, *, query):
"""Plays a file from the local filesystem"""
@@ -85,8 +83,6 @@ class Player(commands.Cog):
ctx.voice_client.play(source, after=lambda e: print('Player error: %s' % e) if e else None)
await ctx.send('Now playing: {}'.format(query))
-
- @commands.check(is_in_vc)
@commands.command()
async def yt(self, ctx, *, url):
"""Plays from a url (almost anything youtube_dl supports)"""
@@ -97,7 +93,6 @@ class Player(commands.Cog):
await ctx.send('Now playing: {}'.format(player.title))
- @commands.check(is_in_vc)
@commands.command()
async def stream(self, ctx, *, url):
"""Streams from a url (same as yt, but doesn't predownload)"""
diff --git a/cogs/utils.py b/cogs/utils.py
index f1cfeba..b7bc9f3 100644
--- a/cogs/utils.py
+++ b/cogs/utils.py
@@ -221,5 +221,9 @@ class Utils(commands.Cog):
async def someone(self, ctx):
await ctx.send(choice(ctx.guild.members).mention)
+ @commands.command()
+ async def roll(self, ctx, pool):
+ await ctx.send(f"You rolled a {randint(0, int(pool))}")
+
def setup(bot):
bot.add_cog(Utils(bot))
diff --git a/custom_commands.json b/custom_commands.json
index 6558699..44e0d48 100644
--- a/custom_commands.json
+++ b/custom_commands.json
@@ -1 +1 @@
-{"/src": "https://www.speedrun.com/mcbe", "/launcher": "https://github.com/MCMrARM/mc-w10-version-launcher/releases/tag/0.1.0", "/locate": "head north", "/boards": "https://www.speedrun.com/mcbe", "/leaderboards": "https://www.speedrun.com/mcbe", "/ban": "shut up", "/ssg": "https://www.speedrun.com/mcbe#Any_Glitchless", "/hoes": "stop asking for this shit", "/Make": "Troll Supermod", "/Don't": "Buy The Sun Newspaper", "/Troll": "is Super at his job", "/troll": "The greatest mod this game has", "/welcome": "Welcome! <:Cake:619552132298964993>", "/pending": "this annoys me", "!murray": "the irishest of the Irish", "!HereWeGo": "10 in a Row!", "!GlasgowRangers": "You Let Your Club Die!", "!hwg": "10 iar", "!When-you-walk-through-a-storm": "hold your head up high", "!At-the-end-of-a-Storm": "there's a golden sky and the sweet silver song of the lark", "!Walk-On": "Walk On with hope in your hearts and You'll Never Walk Alone", "!Walk-On-through-the-Wind": "Walk On through the rain", "!For-your-dreams": "be tossed and blown", "!When-you-walk": "through a storm hold your head up high and don't be afraid of the dark\nAt the end of a Storm there's a golden sky and the sweet silver song of the lark\nWalk on through the wind\nWalk on through the rain, for your dreams be tossed and blown\nWalk On, Walk On with hope in your hearts and You'll Never Walk Alone, **YOU'LL NEVER WALK ALONE**\nWalk On, Walk On with hope in your hearts and You'll Never Walk Alone, **YOU'LL NEVER WALK ALONE**", "!Scotland'sNo1": "Celtic", "/swipe": "not an alt", "!blacklist": "Done! That felt good", "/blacklist": "Done! That felt good", "!sr.c": "https://www.speedrun.com/mcbe", "!h": "<@!199070670221475842> no swearing in this christian discord server"} \ No newline at end of file
+{"/src": "https://www.speedrun.com/mcbe", "/launcher": "https://github.com/MCMrARM/mc-w10-version-launcher/releases/tag/0.1.0", "/locate": "head north", "/boards": "https://www.speedrun.com/mcbe", "/leaderboards": "https://www.speedrun.com/mcbe", "/ban": "shut up", "/ssg": "https://www.speedrun.com/mcbe#Any_Glitchless", "/hoes": "stop asking for this shit", "/Make": "Troll Supermod", "/Don't": "Buy The Sun Newspaper", "/Troll": "is Super at his job", "/troll": "The greatest mod this game has", "/welcome": "Welcome! <:Cake:619552132298964993>", "/pending": "this annoys me", "!murray": "the irishest of the Irish", "!HereWeGo": "10 in a Row!", "!GlasgowRangers": "You Let Your Club Die!", "!hwg": "10 iar", "!When-you-walk-through-a-storm": "hold your head up high", "!At-the-end-of-a-Storm": "there's a golden sky and the sweet silver song of the lark", "!Walk-On": "Walk On with hope in your hearts and You'll Never Walk Alone", "!Walk-On-through-the-Wind": "Walk On through the rain", "!For-your-dreams": "be tossed and blown", "!When-you-walk": "through a storm hold your head up high and don't be afraid of the dark\nAt the end of a Storm there's a golden sky and the sweet silver song of the lark\nWalk on through the wind\nWalk on through the rain, for your dreams be tossed and blown\nWalk On, Walk On with hope in your hearts and You'll Never Walk Alone, **YOU'LL NEVER WALK ALONE**\nWalk On, Walk On with hope in your hearts and You'll Never Walk Alone, **YOU'LL NEVER WALK ALONE**", "!Scotland'sNo1": "Celtic", "/swipe": "not an alt", "!blacklist": "Done! That felt good", "/blacklist": "Done! That felt good", "!sr.c": "https://www.speedrun.com/mcbe", "!h": "<@!199070670221475842> no swearing in this christian discord server", "!lenny": "( \u0361\u00b0 \u035c\u0296 \u0361\u00b0)"} \ No newline at end of file