Skip to content

Instantly share code, notes, and snippets.

View SkyLeite's full-sized avatar
🏳️‍⚧️

Sky Leite SkyLeite

🏳️‍⚧️
View GitHub Profile
import discord
from discord.ext import commands
from shutil import copyfile
import pickle
import asyncio
import json, unidecode, requests, threading, fileinput, copy
client = discord.Client()
@client.event
import discord
from discord.ext import commands
from shutil import copyfile
import pickle
import asyncio
import json, unidecode, requests, threading, fileinput, copy
client = discord.Client()
channel = discord.Object("121156929409122306")
async def playMeme(message, client, meme):
if message.author.voice_channel is not None:
channel = message.author.voice_channel
file = "audio/%s" % meme
meme = re.sub('\.mp3$', '', meme)
voice = await client.join_voice_channel(channel)
player = voice.create_ffmpeg_player(file, after=lambda: disconnect(client, voice))
player.start()
admin = 'False'
if message.content == '!eq enable':
for item in message.author.roles:
if item.name == "Administrator":
await addEQChannel(message, client)
admin = 'True'
if admin == 'False':
await client.send_message(message.channel, "You need the 'Administrator' role to do that.")
try:
string = '\n'.join(eqs)
message = ':mega: **%s JST Emergency Quest Notice**\n\n%s' % (eqtime, string)
for item in eq_channels['channels']:
channel = discord.Object(item)
server = get_server(item)
await client.send_message(channel, message)
await client.send_message(test_channel, 'EQ Alert sent to: ``%s`` (%s)' % (server.name, server.id))
except Exception as exception:
import os
def go():
for i in range(0,30):
print(" "*i+".__ __. __ ______ _______ .___ ___. _______ .___ ___. _______ ")
print(" "*i+"| \ | | | | / || ____| | \/ | | ____|| \/ | | ____|")
print(" "*i+"| \| | | | | ,----'| |__ | \ / | | |__ | \ / | | |__ ")
print(" "*i+"| . ` | | | | | | __| | |\/| | | __| | |\/| | | __| ")
print(" "*i+"| |\ | | | | `----.| |____ | | | | | |____ | | | | | |____ ")
print(" "*i+"|__| \__| |__| \______||_______| |__| |__| |_______||__| |__| |_______|")
import os
def go():
for i in range(0,30):
print(" "*i+".__ __. __ ______ _______ .___ ___. _______ .___ ___. _______ \n"+" "*i+"| \ | | | | / || ____| | \/ | | ____|| \/ | | ____|\n"+" "*i+"| \| | | | | ,----'| |__ | \ / | | |__ | \ / | | |__ \n"+" "*i+"| . ` | | | | | | __| | |\/| | | __| | |\/| | | __| \n"+" "*i+"| |\ | | | | `----.| |____ | | | | | |____ | | | | | |____ \n"+" "*i+"|__| \__| |__| \______||_______| |__| |__| |_______||__| |__| |_______|")
os.system('cls')
def back():
for i in range(0,30):
j = 30-i
import os
for i in range(0,30):
print(" "*i+".__ __. __ ______ _______ .___ ___. _______ .___ ___. _______ \n"+" "*i+"| \ | | | | / || ____| | \/ | | ____|| \/ | | ____|\n"+" "*i+"| \| | | | | ,----'| |__ | \ / | | |__ | \ / | | |__ \n"+" "*i+"| . ` | | | | | | __| | |\/| | | __| | |\/| | | __| \n"+" "*i+"| |\ | | | | `----.| |____ | | | | | |____ | | | | | |____ \n"+" "*i+"|__| \__| |__| \______||_______| |__| |__| |_______||__| |__| |_______|")
os.system('cls')
for i in range(0,30):
j = 30-i
print(" "*j+".__ __. __ ______ _______ .___ ___. _______ .___ ___. _______ \n"+" "*j+"| \ | | | | / || ____| | \/ | | ____|| \/ | | ____|\n"+" "*j+"| \| | | | | ,----'| |__ | \ / | | |__ | \ / | | |__ \n"+" "*j+"| . ` | | | | | | __| | |\/| | | __| | |\/| | | __| \n"+" "*j+"| |\ | | | | `----.| |____ | | |
for item in eq_channels['channels']: #reads every channel on eq_channels.json
if client.get_channel(item): #checks if the channel exists
channel = client.get_channel(item)
await client.send_message(discord.Object(item), message) #sends message to channel if it does
if client.get_channel(test_channel): #checks if test_channel exists (logging channel)
await client.send_message(discord.Object(test_channel), 'EQ Alert sent to: ``%s`` (%s)' % (
channel.server.name, channel.server.id)) #sends 'EQ Alert sent to: (servername)' to logging channel
for item in eq_channels['channels']: #reads every channel on eq_channels.json
if client.get_channel(item): #checks if the channel exists
channel = client.get_channel(item)
await client.send_message(discord.Object(item), message) #sends message to channel if it does
if client.get_channel(test_channel): #checks if test_channel exists (logging channel)
await client.send_message(discord.Object(test_channel), 'EQ Alert sent to: ``%s`` (%s)' % (
channel.server.name, channel.server.id)) #sends 'EQ Alert sent to: (servername)' to logging channel