Compare commits
4 commits
be7db764ec
...
a344db3ad1
Author | SHA1 | Date | |
---|---|---|---|
a344db3ad1 | |||
559d8c2169 | |||
91a75741bf | |||
f16042d81a |
3 changed files with 48 additions and 24 deletions
28
bot.py
28
bot.py
|
@ -188,24 +188,6 @@ async def emoji_text(ctx, message: discord.Message):
|
|||
modal.set_message_id(message.id)
|
||||
await ctx.interaction.response.send_modal(modal)
|
||||
|
||||
@bot.command(help="veraltet", usage="", hidden=True)
|
||||
@is_member()
|
||||
async def yesno(ctx):
|
||||
await ctx.message.delete()
|
||||
await ctx.send(content="Sorry das geht so nicht. Der Befehl hat sich geändert in !vote... für mehr Informationen schreib bitte !help oder frage deinen Admin oder Apotheker. Liebste Grüße, SecondBot <3", delete_after=20.0)
|
||||
|
||||
@bot.command(help="Zeigt alte Hilfe", usage="")
|
||||
@is_member()
|
||||
async def helpme(ctx):
|
||||
if admin(ctx):
|
||||
admin_text = "\n\n!add = Hinzufügen einer Rolle mit Textchannel und hinzufügen von Usern zur Rolle\nNutzung: !add \"<Rolle>\" <User Mentions>\n\n!labor = bringt dich ins Labor :)\nNutzung: !labor\n\n!start = Starte ne Runde PnP\nNutzung: !start @Rolle\n\n!stop = Beende die gestartete Runde PnP\nNutzung: !stop\n\n!purge = Löschen von Nachrichten\nNutzung: !purge all|<Anzahl>|x minutes/hours/days/weeks\n\n!prune - kickt Member ohne Rolle, die 30 Tage nicht online waren\nNutzung: !prune"
|
||||
else:
|
||||
admin_text = ""
|
||||
em = discord.Embed(title="Hilfe",description="!survey = Umfrage mit mehreren Antwortmöglichkeiten\nNutzung: !survey <Frage> | <Antwort1> | <Antwort2> ...\n\n!vote = Ja/Nein Umfrage\nNutzung: !vote <Frage>\n\n!love = zeige einem User Liebe\nNutzung: !love <@User1> <@User2> ...\n\n!roll = Rolle einen oder mehrere Würfel\nNutzung: !roll <anzahl_optional>W<seitenzahl> (z.B. !roll W20 oder !roll 10W6)%s" % admin_text, colour=0x00FF00)
|
||||
if ctx.author.dm_channel == None:
|
||||
await ctx.author.create_dm()
|
||||
await ctx.author.dm_channel.send(embed=em)
|
||||
|
||||
@bot.command(help="Umfrage mit mehreren Antwortmöglichkeiten", usage="<Frage> | <Antwort1> | <Antwort2> ...")
|
||||
@is_member()
|
||||
async def survey(ctx, *, arg):
|
||||
|
@ -219,7 +201,7 @@ async def survey(ctx, *, arg):
|
|||
desc = desc + emojinumbers[z] + " - " + y + "\n"
|
||||
z = z + 1
|
||||
em = discord.Embed(title=question, description=desc, colour=0x00E0FF)
|
||||
em.set_author(name=ctx.author.display_name, url=discord.Embed.Empty, icon_url=ctx.author.avatar.url)
|
||||
em.set_author(name=ctx.author.display_name, url=None, icon_url=ctx.author.avatar.url)
|
||||
ask_msg = await ctx.send(content="||@everyone||",embed=em)
|
||||
a = 0
|
||||
for x in emojinumbers:
|
||||
|
@ -244,7 +226,7 @@ async def surveyedit(ctx, *, arg):
|
|||
desc = desc + emojinumbers[z] + " - " + y + "\n"
|
||||
z = z + 1
|
||||
em = discord.Embed(title=question, description=desc, colour=0x00E0FF)
|
||||
em.set_author(name=ctx.author.display_name, url=discord.Embed.Empty, icon_url=ctx.author.avatar.url)
|
||||
em.set_author(name=ctx.author.display_name, url=None, icon_url=ctx.author.avatar.url)
|
||||
survey_msg = await ctx.channel.fetch_message((int(survey_id)))
|
||||
await survey_msg.edit(embed=em)
|
||||
|
||||
|
@ -253,7 +235,7 @@ async def surveyedit(ctx, *, arg):
|
|||
async def vote(ctx, *, arg):
|
||||
await ctx.message.delete()
|
||||
em = discord.Embed(description=arg, colour=0x00E0FF)
|
||||
em.set_author(name=ctx.author.display_name, url=discord.Embed.Empty, icon_url=ctx.author.avatar.url)
|
||||
em.set_author(name=ctx.author.display_name, url=None, icon_url=ctx.author.avatar.url)
|
||||
ask_msg = await ctx.send(content="||@everyone||",embed=em)
|
||||
for x in ["✅", "❔", "❌"]:
|
||||
await ask_msg.add_reaction(x)
|
||||
|
@ -396,7 +378,7 @@ async def purge(ctx, *, arg):
|
|||
deleted = await ctx.channel.purge(limit=limit)
|
||||
await ctx.send(content='Ich habe {} Nachrichten gelöscht.'.format(len(deleted)), delete_after=5.0)
|
||||
|
||||
@bot.command(help="zeige einem User Liebe", usage="<@User1> <@User2> ...", hidden=True)
|
||||
@bot.command(help="zeige einem User Liebe", usage="<@User1> <@User2> ...")
|
||||
@is_member()
|
||||
async def liebe(ctx, *, arg):
|
||||
await ctx.message.delete()
|
||||
|
@ -405,7 +387,7 @@ async def liebe(ctx, *, arg):
|
|||
await user.create_dm()
|
||||
await user.dm_channel.send("❤️ von {}".format(ctx.author.display_name))
|
||||
|
||||
@bot.command(help="zeige einem User Hiebe", usage="<@User1> <@User2> ...", hidden=True)
|
||||
@bot.command(help="zeige einem User Hiebe", usage="<@User1> <@User2> ...")
|
||||
@is_member()
|
||||
async def hiebe(ctx, *, arg):
|
||||
await ctx.message.delete()
|
||||
|
|
|
@ -1 +1 @@
|
|||
py-cord==2.4.1
|
||||
py-cord==2.6.0
|
||||
|
|
42
survey.py
Normal file
42
survey.py
Normal file
|
@ -0,0 +1,42 @@
|
|||
import discord
|
||||
import asyncio
|
||||
import time
|
||||
import datetime
|
||||
import random
|
||||
import os
|
||||
from os import system
|
||||
from os import environ
|
||||
from discord.ext import commands
|
||||
from discord.commands import Option
|
||||
from discord.commands import permissions
|
||||
from discord.ui import InputText, Modal
|
||||
|
||||
def left(s, amount):
|
||||
return s[:amount]
|
||||
|
||||
def right(s, amount):
|
||||
return s[-amount:]
|
||||
|
||||
def mid(s, offset, amount):
|
||||
return s[offset:offset+amount]
|
||||
|
||||
token = os.environ['TOKEN']
|
||||
survey_channel = os.environ['SURVEY_CHANNEL']
|
||||
mention_id = os.environ['MENTION_ID']
|
||||
guild_id = os.environ['GUILD_ID']
|
||||
runtime = 48
|
||||
|
||||
bot = discord.Bot(description=None)
|
||||
|
||||
@bot.event
|
||||
async def on_ready():
|
||||
print("Bot ready on Version %s..." % discord.__version__)
|
||||
# build survey
|
||||
po = discord.Poll(question="Wie habt ihr nächste Woche Zeit?", answers=[discord.PollAnswer(text="Montag", emoji="1\u20E3"), discord.PollAnswer(text="Dienstag", emoji="2\u20E3"), discord.PollAnswer(text="Mittwoch", emoji="3\u20E3"), discord.PollAnswer(text="Donnerstag", emoji="4\u20E3"), discord.PollAnswer(text="Freitag", emoji="5\u20E3"), discord.PollAnswer(text="Samstag", emoji="6\u20E3"), discord.PollAnswer(text="Sonntag", emoji="7\u20E3"), discord.PollAnswer(text="keine Zeit", emoji="❌")], duration=runtime, allow_multiselect=True)
|
||||
# send message
|
||||
msg = await bot.get_channel(survey_channel).send(content="||%s||"% bot.get_guild(guild_id).get_role(mention_id).mention ,poll=po)
|
||||
await msg.create_thread(name="Diskussion")
|
||||
# close connection
|
||||
await bot.close()
|
||||
|
||||
bot.run(token)
|
Loading…
Reference in a new issue