|
@ -9,8 +9,6 @@ import aiohttp |
|
|
import mimetypes |
|
|
import mimetypes |
|
|
import requests |
|
|
import requests |
|
|
|
|
|
|
|
|
# import subprocess |
|
|
|
|
|
|
|
|
|
|
|
bot = commands.Bot(command_prefix=".", intents=discord.Intents.default(), |
|
|
bot = commands.Bot(command_prefix=".", intents=discord.Intents.default(), |
|
|
case_insensitive=True) |
|
|
case_insensitive=True) |
|
|
|
|
|
|
|
@ -23,7 +21,6 @@ logging.basicConfig(filename='console.log', |
|
|
) |
|
|
) |
|
|
logging.getLogger().addHandler(logging.StreamHandler(sys.stdout)) |
|
|
logging.getLogger().addHandler(logging.StreamHandler(sys.stdout)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@bot.event |
|
|
@bot.event |
|
|
async def on_ready(): |
|
|
async def on_ready(): |
|
|
# Marks bot as running |
|
|
# Marks bot as running |
|
@ -61,7 +58,7 @@ async def on_message(message): |
|
|
response = response + "\nRequested by " + message.author.mention |
|
|
response = response + "\nRequested by " + message.author.mention |
|
|
if truncated: |
|
|
if truncated: |
|
|
response = response + "\n(file was truncated because it was too long.)" |
|
|
response = response + "\n(file was truncated because it was too long.)" |
|
|
embed_var = discord.Embed(title="Please use a paste service", color=0x1D83D4) |
|
|
|
|
|
|
|
|
embed_var = discord.Embed(title="Converted to an online paste file: ", color=0x1D83D4) |
|
|
embed_var.description = response |
|
|
embed_var.description = response |
|
|
try: |
|
|
try: |
|
|
await message.channel.send(embed=embed_var) |
|
|
await message.channel.send(embed=embed_var) |
|
@ -85,7 +82,7 @@ async def on_message(message): |
|
|
key = json.loads(await req.read())['key'] |
|
|
key = json.loads(await req.read())['key'] |
|
|
response = "" |
|
|
response = "" |
|
|
response = response + "https://bin.birdflop.com/" + key |
|
|
response = response + "https://bin.birdflop.com/" + key |
|
|
response = response + "\nRequested by " + message.author.mention |
|
|
|
|
|
|
|
|
response = response + "\nUploaded by " + message.author.mention |
|
|
if truncated: |
|
|
if truncated: |
|
|
response = response + "\n(file was truncated because it was too long.)" |
|
|
response = response + "\n(file was truncated because it was too long.)" |
|
|
embed_var = discord.Embed(title="Pastebin is blocked in some countries", color=0x1D83D4) |
|
|
embed_var = discord.Embed(title="Pastebin is blocked in some countries", color=0x1D83D4) |
|
@ -103,23 +100,8 @@ async def on_message(message): |
|
|
async def ping(ctx): |
|
|
async def ping(ctx): |
|
|
await ctx.send(f'Bot ping is {round(bot.latency * 1000)}ms') |
|
|
await ctx.send(f'Bot ping is {round(bot.latency * 1000)}ms') |
|
|
|
|
|
|
|
|
@bot.command() |
|
|
|
|
|
async def invite(ctx): |
|
|
|
|
|
await ctx.send('Invite me with this link:\n-not setup-') |
|
|
|
|
|
|
|
|
|
|
|
@bot.command(name="react", pass_context=True) |
|
|
|
|
|
@has_permissions(administrator=True) |
|
|
|
|
|
async def react(ctx, url, reaction): |
|
|
|
|
|
channel = await bot.fetch_channel(int(url.split("/")[5])) |
|
|
|
|
|
message = await channel.fetch_message(int(url.split("/")[6])) |
|
|
|
|
|
await message.add_reaction(reaction) |
|
|
|
|
|
logging.info('reacted to ' + url + ' with ' + reaction) |
|
|
|
|
|
|
|
|
|
|
|
for file_name in os.listdir('./cogs'): |
|
|
for file_name in os.listdir('./cogs'): |
|
|
if file_name.endswith('.py'): |
|
|
if file_name.endswith('.py'): |
|
|
bot.load_extension(f'cogs.{file_name[:-3]}') |
|
|
bot.load_extension(f'cogs.{file_name[:-3]}') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bot.run(token) |
|
|
bot.run(token) |
|
|
|
|
|
|
|
|
# full name: message.author.name + "#" + str(message.author.discriminator) + " (" + str(message.author.id) + ")" |
|
|
|
|
|