def addmeme(ctx, *args, member: discord.Member = None):
if member is None:
member = ctx.message.author
if args:
if 'youtu' in args[0] or 'gfycat' in args[0] or 'imgur' in args[0] or 'streamable' in args[0] or 'redd' in args[0]:
cur.execute("SELECT status FROM links WHERE link = ?", (args[0],))
check = cur.fetchone()
if check is None:
cur.execute("INSERT INTO links (link, status, submitter_id, submitter_name) VALUES (?, 'review', ?, ?)", (args[0], member.id, member.name))
conn.commit()
cur.execute("SELECT count(*) FROM links WHERE status = 'review'")
count = cur.fetchone()[0]
if count == 1:
await yeebot.send_message(yeebot.get_channel(review_channel_id), 'There is 1 link awaiting review.'.format(count))
else:
await yeebot.send_message(yeebot.get_channel(review_channel_id), 'There are {} links awaiting review.'.format(count))
await yeebot.delete_message(ctx.message)
return await yeebot.say("`{}` has been submitted for review.".format(args[0]))
else:
return await yeebot.say("Sorry, that link has already been submitted. It is currently in status: `{}`".format(check[0]))
else:
return await yeebot.say("Please only submit links from Youtube, gfycat, streamable, or imgur.")
else:
return await yeebot.say("Please use the format: `!addmeme https://link.to.meme/meme`")
评论列表
文章目录