some first code added. hope the bot.ini doesnt get uploaded. :) for it to work, rename bot.ini.example to bot.ini, edit the file and install discord.py dependency.

This commit is contained in:
Uwe Pfeifer 2022-05-26 15:30:48 +02:00
parent ea4de10330
commit 3f4255ab64
6 changed files with 63 additions and 14 deletions

View file

@ -0,0 +1,41 @@
# pybot-f by freakyy85 (freaky@freakyonline.de)
import configparser
import discord
from discord.ext import commands
description = '''Testing this bot stuff :)'''
intents = discord.Intents.default()
intents.members = True
intents.message_content = True
# Config loading
config = configparser.ConfigParser()
config.read('bot.ini')
bottoken = config['General']['bottoken']
bot = commands.Bot(command_prefix='?', description=description, intents=intents)
@bot.event
async def on_ready():
print(f'Logged in as {bot.user} (ID: {bot.user.id})')
print('------')
@bot.command()
async def repeat(ctx, times: int, content='repeating...'):
"""Repeats a message multiple times."""
for i in range(times):
await ctx.send(content)
@bot.command()
async def joined(ctx, member: discord.Member):
"""Says when a member joined."""
await ctx.send(f'{member.name} joined {discord.utils.format_dt(member.joined_at)}')
bot.run('OTc5MzU2MjY4NzkzODMxNDI1.GTX-gW.l7Oc7YoVfAQIUBarQ3jXB6upNKYdD0jeCuAGXE')