Skip to content

Commit

Permalink
!suggest geaddet, benutzer können nun feedback geben (und ":D" musste…
Browse files Browse the repository at this point in the history
… leider entfernt werden :(

)
  • Loading branch information
LuminatiHD committed Nov 3, 2021
1 parent 7a30b4c commit 2af2ec8
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Buttons.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ async def MyButton(self, button:nextcord.ui.Button, interaction:nextcord.Interac
"""self.stop() heisst, d class höret uf z runne, aso nimmt keni inputs meh. Ds isch hiufriich weme
usserhaub vor class sitzet. Wöu weme es Buttonobject Button kreiert, de chame mit
await Button.wait()
druf warte, dass dr button stoppet."""
druf warte, dass dr button stoppet. Mä chönnti zwar vilech es attribute self.ispressed oder so mache,
de muesme dr button ou nid neu generiere weme dr button mehrmaus bruucht."""


class PageButtons(nextcord.ui.View): # buttons für d siitene
Expand Down
1 change: 1 addition & 0 deletions USERSUGGESTIONS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Suggestions:
37 changes: 37 additions & 0 deletions cogs/specialcmds.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import datetime

import nextcord
from nextcord.ext import commands
from nextcord.ext.commands.context import Context


class extracmds(commands.Cog):
def __init__(self, bot:commands.Bot):
self.bot = bot

# @commands.event
# async def on_message(self, message):
# """isch absolut useless, nur da für fun."""
# if message.content in [":(", ":D", "D:", ">:("] and self.bot.user != message.author:
# await message.channel.send(message.content)

@commands.command(name="suggest", aliases=["suggestion", "Suggest", "Suggestion", "S", "s"])
async def recommend(self, ctx: commands.context.Context):
"""Mit däm command chame vorschläg bringe. die wäre när m textfile USERSUGGESTIONS.txt ufeglade."""
await ctx.channel.send("Vorschlag: ")

time = datetime.datetime.now()
time = f"{time.hour:02}:{time.minute:02}:{time.second:02}, {time.day:02}.{time.month:02}.{str(time.year)[-2::]}"
# ds {time.x:02} isch eifach nur da für weme z.B. ä uhrzit vo 9:16:1 het, dass drus när 09:16:1 wird.
# So isch ds Layout nicer.

suggestion = await self.bot.wait_for("message", check=lambda msg: msg.author == ctx.author)

with open(r"C:\Users\yoanm\Workspace\Hausaufgabenbot\USERSUGGESTIONS.txt", "a") as file:
file.write(f"\n\n- [{time}] {ctx.author.name}: {suggestion.content}")

await ctx.channel.send("Vorschlag wurde eingetragen.")


def setup(client):
client.add_cog(extracmds(client))
3 changes: 2 additions & 1 deletion editItem.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ async def editItem(self, ctx, selecteditem):
confirm = Buttons.Confirm(ctx)
while not confirm.confirm:
newacc = Buttons.ManageItemAccess(ctx)
confirm = Buttons.Confirm(ctx)
confirm = Buttons.Confirm(ctx) # ig tue dr button neu generiere wöu schüsch chasch dr button nümme drücke
# de funktioniert z confirme nid.
await editor.edit(content="Zugriff: ", view=newacc)
await newacc.wait()
oldaccess = selecteditem[4]
Expand Down
9 changes: 4 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@
async def on_ready():
await client.change_presence(status=nextcord.Status.idle, activity=nextcord.Game('Hello there!'))
print('Ready')
@client.event
async def on_message(message):
"""isch absolut useless, nur da für fun."""
if message.content in [":(", ":D", "D:", ">:("] and client.user != message.author:
await message.channel.send(message.content)

client.load_extension("cogs.newItem")
client.load_extension("cogs.searchItem")
client.load_extension("cogs.specialcmds")




client.run('ODk5MjI0MDI1Nzk1MDAyMzY4.YWvpog.s31oLtCJ8TIujHaoYBtZmWXDWu0')

0 comments on commit 2af2ec8

Please sign in to comment.