up db test

This commit is contained in:
2022-06-26 08:10:49 +03:00
parent 51acb6e60c
commit dc1f3b07b2

33
test2.py Normal file
View File

@@ -0,0 +1,33 @@
import discord
import dislash
from discord.ext import commands
from dislash.slash_commands import check
bot = commands.Bot(command_prefix="!")
inter_client = dislash.InteractionClient(bot)
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")