Exemplo n.º 1
0
async def echo(ctx):
    server = ctx.guild
    adminChannel = discord.utils.get(server.channels, name="staff-commands")
    if ctx.channel == adminChannel:
        fullMsg = ctx.message.content.split(" ")
        if len(fullMsg) >= 3:
            channel = fullMsg[1].replace("<", "").replace("#",
                                                          "").replace(">", "")
            channel = bot.get_channel(int(channel))
            msg = " "
            msg = msg.join(fullMsg[2:])
            await channel.send(msg)
Exemplo n.º 2
0
async def on_raw_reaction_remove(payload):
    server = bot.get_guild(payload.guild_id)
    member = server.get_member(payload.user_id)
    userMention = member.mention
    studentChannel = discord.utils.get(server.channels, name="student-roles")
    channel = bot.get_channel(payload.channel_id)
    reaction = payload.emoji.name
    if studentChannel == channel:
        if reaction == "oscp" or reaction == "oswp" or reaction == "oswe" or reaction == "osce" or reaction == "wapt":
            role = discord.utils.get(server.roles,
                                     name="%s Student" % reaction.upper())
            roleMention = role.mention
            await member.remove_roles(role)
            delmsg = await channel.send("%s - you have been removed from %s" %
                                        (userMention, roleMention))
            await delmsg.delete(delay=10.0)
Exemplo n.º 3
0
async def multipin(ctx):
    server = ctx.guild
    adminChannel = discord.utils.get(server.channels, name="staff-commands")
    if ctx.channel == adminChannel:
        fullMsg = ctx.message.content.split(" ")
        if len(fullMsg) >= 3:
            channels = []
            for i, w in enumerate(fullMsg[1:]):
                if w.startswith("<#"):
                    channel = w.replace("<", "").replace("#",
                                                         "").replace(">", "")
                    channel = bot.get_channel(int(channel))
                    channels.append(channel)
                else:
                    pinMsg = fullMsg[i + 1:]
                    break

            for channel in channels:
                msg = " "
                msg = msg.join(pinMsg)
                msg = await channel.send(msg)
                await discord.Message.pin(msg)
Exemplo n.º 4
0
async def courseleak(ctx):
    userMsg = ctx.message.content()
    channel = bot.get_channel('701897816498241626')
    await channel.send("User Reported: " + userMsg)
    channel = ctx.channel
    await channel.send("We've sent this to offsec staff")