QuestionD1scord Bot request

Posts 1–5 of 5 · Page 1 of 1
D1scord Bot request
Hello everyone,

is it possible to program a D1scord bot that can do the following:

- Same function as "BotGhost" (moderation/greeting/music)
- Rank assignment for specific (good) activity
- Rank deprivation for insufficient (bad) activity
- Automatic server kick from inactive users
- Deployment of the bot on multiple servers


Is there any open source code that can be adapted accordingly and if so, maybe someone here can?
If not, which programming language is required to implement these requirements for the bot?

If someone could implement these requirements, payment would of course also be negotiable.

Unfortunately, the paid bots cannot do all of the above functions (ranking/unranking for a self-defined activity and server kick for inactivity).

Sorry for my bad english, I used google translator..

Thanks in advance.
can be done yes, is easy? no, can pay bot do that yes but you have to find a developer/coder to do the bot for you.
The Ranking unranking and kick inactivity, the bot need a loop to check that each x time
a
i was thinking you share it
Yes, this is possible.

The most difficult part is the custom activity/rank system. A good approach is to store user activity in a database and use it to assign or remove Discord roles automatically.

Below is a simple example using Python and discord.py.

This example:
- tracks user messages;
- stores activity points;
- gives a role after reaching a certain amount of activity;
- can be extended with inactivity checks, rank removal, voice activity and custom server rules.

Install:

pip install discord.py

Code:
import discord
from discord.ext import commands
import sqlite3

TOKEN = "YOUR_TOKEN"

intents = discord.Intents.all()

bot = commands.Bot(
    command_prefix="!",
    intents=intents
)

db = sqlite3.connect("activity.db")
cursor = db.cursor()

cursor.execute("""
CREATE TABLE IF NOT EXISTS users(
    user_id INTEGER,
    guild_id INTEGER,
    points INTEGER
)
""")

db.commit()

 @bot.event
async def on_ready():
    print(f"Logged in as {bot.user}")

 @bot.event
async def on_message(message):

    if message.author.bot:
        return

    cursor.execute(
        "SELECT points FROM users WHERE user_id=? AND guild_id=?",
        (message.author.id, message.guild.id)
    )

    result = cursor.fetchone()

    if result:
        points = result[0] + 1

        cursor.execute(
            "UPDATE users SET points=? WHERE user_id=? AND guild_id=?",
            (
                points,
                message.author.id,
                message.guild.id
            )
        )

    else:
        points = 1

        cursor.execute(
            "INSERT INTO users VALUES (?, ?, ?)",
            (
                message.author.id,
                message.guild.id,
                points
            )
        )

    db.commit()


    # Example rank system

    if points >= 100:

        role = discord.utils.get(
            message.guild.roles,
            name="Active Member"
        )

        if role:
            await message.author.add_roles(role)


    await bot.process_commands(message)



@bo*****mmand()
async def rank(ctx):

    cursor.execute(
        "SELECT points FROM users WHERE user_id=? AND guild_id=?",
        (
            ctx.author.id,
            ctx.guild.id
        )
    )

    result = cursor.fetchone()

    if result:
        await ct*****nd(
            f"Your activity points: {result[0]}"
        )
    else:
        await ct*****nd(
            "No activity data found."
        )


bot.run(TOKEN)
this is easy nowadays imo with codex, claude code, etc. just give it a discord api key and have it create the bot and a test suite that simulates users and whatever to test it
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?