1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-11-01 21:02:38 +00:00

Did stuff and things

This commit is contained in:
Myned 2017-09-25 15:31:51 -04:00
parent 0cb8f2876b
commit 0f9c961966
3 changed files with 13 additions and 8 deletions

View file

@ -80,7 +80,7 @@ class MsG:
await ctx.trigger_typing() await ctx.trigger_typing()
await ctx.send('' + ctx.message.author.mention + ' **Probable match:**\n' + scraper.check_match('http://iqdb.harry.lu/?url=' + url)) await ctx.send('' + ctx.message.author.mention + ' **Probable match:**\n' + scraper.check_match('http://iqdb.harry.lu/?url=' + url))
except exc.MatchError: except exc.MatchError:
await ctx.send('' + ctx.message.author.mention + ' **No probable match.**') await ctx.send('' + ctx.message.author.mention + ' **No probable match.**', delete_after=10)
except Exception: except Exception:
await ctx.send(exc.base) await ctx.send(exc.base)
traceback.print_exc(limit=1) traceback.print_exc(limit=1)

View file

@ -45,14 +45,13 @@ class Utils:
@commands.group(name=',send', aliases=[',s'], hidden=True) @commands.group(name=',send', aliases=[',s'], hidden=True)
@commands.is_owner() @commands.is_owner()
@checks.del_ctx()
async def send(self, ctx): async def send(self, ctx):
pass pass
@send.command(name='guild', aliases=['g', 'server', 's']) @send.command(name='guild', aliases=['g', 'server', 's'])
@checks.del_ctx()
async def send_guild(self, ctx, guild, channel, *message): async def send_guild(self, ctx, guild, channel, *message):
await discord.utils.get(self.bot.get_all_channels(), guild__name=guild, name=channel).send(formatter.tostring(message)) await discord.utils.get(self.bot.get_all_channels(), guild__name=guild, name=channel).send(formatter.tostring(message))
@send.command(name='user', aliases=['u', 'member', 'm']) @send.command(name='user', aliases=['u', 'member', 'm'])
@checks.del_ctx()
async def send_user(self, ctx, user, *message): async def send_user(self, ctx, user, *message):
await discord.utils.get(self.bot.get_all_members(), id=int(user)).send(formatter.tostring(message)) await discord.utils.get(self.bot.get_all_members(), id=int(user)).send(formatter.tostring(message))

View file

@ -24,15 +24,15 @@ bot = commands.Bot(command_prefix=commands.when_mentioned_or(config['prefix']),
@bot.event @bot.event
async def on_ready(): async def on_ready():
if isinstance(bot.get_channel(config['startup_channel']), discord.TextChannel): if isinstance(bot.get_channel(config['startup_channel']), discord.TextChannel):
await bot.get_channel(config['startup_channel']).send('H3l1(0) hOw aR3? **H4VE dAy.** 🌈') await bot.get_channel(config['startup_channel']).send('H3l1(0) hOw aR3? **H4vE dAy.** 🌈')
print('Connected.') print('Connected.')
print('Username: ' + bot.user.name) print('Username: ' + bot.user.name)
print('-------') print('-------')
# Close connection to Discord - immediate offline # Close connection to Discord - immediate offline
@bot.command(name=',die', aliases=[',d', ',close', ',kill'], brief='Kills the bot', description='BOT OWNER ONLY\nCloses the connection to Discord', hidden=True) @bot.command(name=',die', aliases=[',d', ',close', ',kill'], brief='Kills the bot', description='BOT OWNER ONLY\nCloses the connection to Discord', hidden=True)
@checks.del_ctx()
@commands.is_owner() @commands.is_owner()
@checks.del_ctx()
async def die(ctx): async def die(ctx):
try: try:
await bot.get_channel(config['shutdown_channel']).send('Am g0 by3e333333eee. **H4v3 n1GhT.** 💤') await bot.get_channel(config['shutdown_channel']).send('Am g0 by3e333333eee. **H4v3 n1GhT.** 💤')
@ -45,8 +45,8 @@ async def die(ctx):
# Invite bot to bot owner's server # Invite bot to bot owner's server
@bot.command(name=',invite', aliases=[',inv', ',link'], brief='Invite the bot', description='BOT OWNER ONLY\nInvite the bot to a server (Requires admin)', hidden=True) @bot.command(name=',invite', aliases=[',inv', ',link'], brief='Invite the bot', description='BOT OWNER ONLY\nInvite the bot to a server (Requires admin)', hidden=True)
@checks.del_ctx()
@commands.is_owner() @commands.is_owner()
@checks.del_ctx()
async def invite(ctx): async def invite(ctx):
try: try:
await ctx.send('🔗 https://discordapp.com/oauth2/authorize?&client_id=' + str(config['client_id']) + '&scope=bot&permissions=' + str(config['permissions'])) await ctx.send('🔗 https://discordapp.com/oauth2/authorize?&client_id=' + str(config['client_id']) + '&scope=bot&permissions=' + str(config['permissions']))
@ -57,7 +57,7 @@ async def invite(ctx):
@bot.command(brief='[IN TESTING]', description='[IN TESTING]', hidden=True) @bot.command(brief='[IN TESTING]', description='[IN TESTING]', hidden=True)
async def hi(ctx): async def hi(ctx):
try: try:
hello = 'Hello, ' + ctx.message.author.mention + '.' hello = 'Hewwo, ' + ctx.message.author.mention + '.'
if ctx.message.author.id == checks.owner_id: if ctx.message.author.id == checks.owner_id:
hello += '.. ***Master.*** uwu' hello += '.. ***Master.*** uwu'
elif ctx.message.author.guild_permissions.administrator: elif ctx.message.author.guild_permissions.administrator:
@ -70,9 +70,15 @@ async def hi(ctx):
traceback.print_exc(limit=1) traceback.print_exc(limit=1)
@bot.command(hidden=True) @bot.command(hidden=True)
@commands.is_owner()
@checks.del_ctx() @checks.del_ctx()
async def test(ctx): async def test(ctx):
pass embed = discord.Embed(title='Title', type='rich', description='Description.', url='https://static1.e621.net/data/4b/3e/4b3ec0c2e8580f418e4ce019dfd5ac32.png', color=discord.Color.from_rgb(255, 255, 255))
embed = embed.set_image('https://static1.e621.net/data/27/0f/270fd28caa5e6d8bf542a76515848e02.png')
embed = embed.set_footer('Footer')
embed = embed.set_author('Author')
embed = embed.set_thumbnail('https://cdn.discordapp.com/attachments/353251794161500163/357707620561453077/9d803ea3-b7fa-401f-89cf-f32cf21fe772.png')
ctx.send('Embed test', embed=embed)
bot.add_cog(info.Info(bot)) bot.add_cog(info.Info(bot))
bot.add_cog(tools.Utils(bot)) bot.add_cog(tools.Utils(bot))