Merge pull request #1 from PowerPCFan/main

Add my whoami script (why not)
This commit is contained in:
WhatDidYouExpect 2025-01-05 19:54:58 +01:00 committed by GitHub
commit dcde62d774
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 0 deletions

View file

@ -2,3 +2,6 @@
[Hello World!](https://github.com/WhatDidYouExpect/goobercustomcommands/blob/main/hello.py) [Hello World!](https://github.com/WhatDidYouExpect/goobercustomcommands/blob/main/hello.py)
by expect by expect
[WhoAmI (lists username and nickname)](https://github.com/WhatDidYouExpect/goobercustomcommands/blob/main/whoami.py)
by PowerPCFan

18
whoami.py Normal file
View file

@ -0,0 +1,18 @@
import discord
from discord.ext import commands
class whoami(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def whoami(self, ctx):
user_id = ctx.author.id
username = ctx.author.name
await ctx.send(
f"Your User ID is: {user_id}\n"
f"Your username is: {username}\n"
f"Your nickname in this server is: <@{user_id}>"
)
async def setup(bot):
await bot.add_cog(whoami(bot))