forked from LyricLy/Discord-Selfbot-Cogs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
alt.py
43 lines (35 loc) · 1.8 KB
/
alt.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import discord, asyncio, datetime
from discord.ext import commands
from cogs.utils.checks import *
def author():
name = "Bluscream"
discriminator = "2597"
id = 97138137679028224
email = "[email protected]"
class AltTester:
"""Let's others use u to check their online- and playing status in DM's"""
version = 1
url = "https://raw.githubusercontent.com/LyricLy/ASCII/master/cogs/alt.json"
active = True
def __init__(self, bot):
self.bot = bot
async def on_message(self, message):
if not self.active: return
if not isinstance(message.channel, discord.abc.PrivateChannel): return
if not message.content.startswith('!'): return
for guild in self.bot.guilds:
member = guild.get_member(message.author.id)
if member: break
if not member: return await message.channel.send(self.bot.bot_prefix + 'Couldn\'t find you on any of my servers, sorry :( #BlameDiscordAPI')
if message.content.lower() == "!status":
await message.channel.send(self.bot.bot_prefix + 'You are currently: `%s`' % member.status)
elif message.content.lower() in ["!game", "!playing"]:
if member.game: await message.channel.send(self.bot.bot_prefix + 'You are currently %s: `%s`' % ( "streaming" if member.game.url else "playing", member.game.name+"="+member.game.url if member.game.url else member.game))
else: await message.channel.send(self.bot.bot_prefix + 'You are currently not playing or streaming anything.')
@commands.command(aliases=['alt'])
async def alttest(self, ctx):
"""Toggles ALT Tester."""
self.active = not self.active
await ctx.message.channel.send( self.bot.bot_prefix + 'ALT Tester set to: `%s`' % self.active)
def setup(bot):
bot.add_cog(AltTester(bot))