up db test

This commit is contained in:
2022-06-27 21:50:26 +03:00
parent 611b722f9a
commit 30e9f0e10e
4 changed files with 268 additions and 181 deletions

View File

@@ -1,33 +1,13 @@
import discord
import dislash
from discord.ext import commands
from dislash.slash_commands import check
from os import walk
bot = commands.Bot(command_prefix="!")
inter_client = dislash.InteractionClient(bot)
f = []
for filenames in walk('audio'):
f.extend(filenames)
break
f = f[2]
files = {}
keys = range(len(f))
for x in f:
files[x] = x
class Greetings(commands.Cog):
def __init__(self, bot):
self.bot = bot
self._last_member = None
@commands.Cog.listener()
async def on_member_join(self, member):
channel = member.guild.system_channel
if channel is not None:
await channel.send('Welcome {0.mention}.'.format(member))
@commands.command()
async def hello(self, ctx, *, member: discord.Member = None):
"""Says hello"""
member = member or ctx.author
if self._last_member is None or self._last_member.id != member.id:
await ctx.send('Hello {0.name}~'.format(member))
else:
await ctx.send('Hello {0.name}... This feels familiar.'.format(member))
self._last_member = member
bot.add_cog(Greetings(bot))
bot.run("OTQ3OTUzOTAxNzgzNjIxNjYy.GTXbMv.KrztaTO7-ivsPEAVjsyikSQ-GP-ANwULmDraig")
print(files)