Skip to content

Autoresponder Variables Docs

Ritik Ranjan edited this page Aug 22, 2023 · 1 revision

Context Class Documentation

The ctx class represents a custom context object containing information about the context of a command. This document outlines the features and usage of the ctx class.

Introduction

The ctx class provides contextual information about the command execution.

Attributes

prefix

  • A string representing the command prefix.

command

  • Placeholder attribute for storing the executed command.

token

  • A token string for authentication purposes.

Attributes

channel

  • An instance of the JinjaChannel class representing the command's channel.

guild

  • An instance of the JinjaGuild class representing the command's guild.

member

  • An instance of the JinjaMember class representing the author of the command.

message

  • An instance of the JinjaMessage class representing the original message.

bot

  • An instance of the bot class providing bot-related attributes and methods.

Methods

send(*args, **kwargs) -> JinjaMessage | None

  • Sends a message to the channel associated with the context.

JinjaGuild Class Documentation

The JinjaGuild class is a custom wrapper around the discord.Guild class, providing convenient methods and properties for interacting with guild-related data. This document outlines the features and usage of the JinjaGuild class.

Introduction

The JinjaGuild class allows you to access various properties and methods related to a guild (server) in Discord.

Properties

id

  • Get the ID of the guild.

name

  • Get the name of the guild.

icon_url

  • Get the URL of the guild's icon.

owner

  • Get a Member instance representing the guild owner.

member_count

  • Get the number of members in the guild.

description

  • Get the guild's description.

banner_url

  • Get the URL of the guild's banner.

vanity_url

  • Get the vanity URL of the guild.

premium_tier

  • Get the premium tier of the guild.

premium_subscription_count

  • Get the count of premium subscriptions in the guild.

preferred_locale

  • Get the preferred locale of the guild.

afk_timeout

  • Get the AFK timeout of the guild.

members

  • Get a list of Member instances representing guild members.

roles

  • Get a list of Role instances representing guild roles.

icon

  • Get the URL of the guild's icon.

splash

  • Get the URL of the guild's splash image.

discovery_splash

  • Get the URL of the guild's discovery splash image.

Methods

get_member(member_id: int) -> JinjaMember | None

  • Get a Member instance representing a member by their ID.

get_role(role_id: int) -> JinjaRole | None

  • Get a Role instance representing a role by its ID.

create_role(name: str, permissions: discord.Permissions, color: discord.Colour, hoist: bool, mentionable: bool, reason: str) -> JinjaRole

  • Create a role in the guild and return a Role instance.

create_voice_channel(name: str, overwrites: dict[Member | Role, discord.PermissionOverwrite], category: Channel, reason: str) -> JinjaChannel

  • Create a voice channel in the guild and return a Channel instance.

create_text_channel(name: str, overwrites: dict[Member | Role, discord.PermissionOverwrite], category: Channel, reason: str) -> JinjaChannel

  • Create a text channel in the guild and return a Channel instance.

get_channel(channel_id: int) -> JinjaChannel | None

  • Get a Channel instance representing a channel by its ID.

JinjaMember Class Documentation

The JinjaMember class is a custom wrapper around the discord.Member and discord.User classes, providing convenient methods and properties for interacting with member-related data. This document outlines the features and usage of the JinjaMember class.

Introduction

The JinjaMember class allows you to access various properties and methods related to a member in a guild (server) on Discord.

Properties

id

  • Get the ID of the member.

name

  • Get the name of the member.

mention

  • Get a mention for the member.

nick

  • Get the nickname of the member in the guild (if applicable).

display_name

  • Get the display name of the member, which considers nicknames.

avatar_url

  • Get the URL of the member's avatar.

Methods

kick(reason: str = None) -> None

  • Kick the member from the guild. Requires appropriate permissions.

ban(reason: str = None, delete_message_days: int = discord.utils.MISSING) -> None

  • Ban the member from the guild. Requires appropriate permissions.

unban(reason: str = None) -> None

  • Unban the member from the guild. Requires appropriate permissions.

add_role(role: discord.Object, reason: str = None) -> None

  • Add a role to the member. Requires appropriate permissions.

remove_role(role: discord.Object, reason: str = None) -> None

  • Remove a role from the member. Requires appropriate permissions.

JinjaMessage Class Documentation

The JinjaMessage class is a custom wrapper around the discord.Message class, providing convenient methods and properties for interacting with message-related data. This document outlines the features and usage of the JinjaMessage class.

Introduction

The JinjaMessage class allows you to access various properties and methods related to a message in a Discord channel.

Properties

id

  • Get the ID of the message.

content

  • Get the content of the message.

author

  • Get a JinjaMember instance representing the author of the message.

channel

  • Get a JinjaChannel instance representing the channel where the message was sent.

guild

  • Get a JinjaGuild instance representing the guild (server) where the message was sent.

Methods

delete(delay: int = 0) -> None

  • Delete the message. Requires appropriate permissions.

pin() -> None

  • Pin the message. Requires appropriate permissions.

JinjaRole Class Documentation

The JinjaRole class is a custom wrapper around the discord.Role class, providing convenient methods and properties for interacting with role-related data. This document outlines the features and usage of the JinjaRole class.

Introduction

The JinjaRole class allows you to access various properties and methods related to a role in a guild (server) on Discord.

Properties

id

  • Get the ID of the role.

name

  • Get the name of the role.

mention

  • Get a mention for the role.

color

  • Get the color of the role.

position

  • Get the position of the role.

hoist

  • Get whether the role is hoisted.

managed

  • Get whether the role is managed.

mentionable

  • Get whether the role is mentionable.

permissions

  • Get the permissions of the role.

guild

  • Get a JinjaGuild instance representing the guild where the role belongs.

members

  • Get a list of JinjaMember instances representing members with the role.

Methods

delete(reason: str = None) -> None

  • Delete the role. Requires appropriate permissions.

edit(reason: str = None, permissions: discord.Permissions = discord.utils.MISSING, color: discord.Color = discord.utils.MISSING, hoist: bool = discord.utils.MISSING, mentionable: bool = discord.utils.MISSING, name: str = discord.utils.MISSING) -> JinjaRole | None

  • Edit the role. Requires appropriate permissions. Returns a JinjaRole instance representing the updated role, or None if the update fails.

Utils Class Documentation

The utils class provides utility methods and attributes from the discord.utils module in discord.py. This document outlines the features and usage of the utils class.

Introduction

The utils class offers convenient utility methods and attributes to simplify various tasks in your Discord bot.

Attributes

MISSING

  • A sentinel value used to indicate a missing value or default argument.

Methods

get(iterable, **attrs) -> Any | None

  • Returns the first item in the iterable that meets the given attributes. Returns None if no matching item is found.

find(predicate, iterable) -> Any | None

  • Returns the first item in the iterable that satisfies the predicate. Returns None if no item satisfies the predicate.

Discord Module Documentation

The discord class acts as a custom module wrapper for various Discord-related classes and utilities. This document outlines the features and usage of the discord class.

Introduction

The discord class provides access to essential classes and utilities for interacting with Discord entities in your bot.

Attributes

utils

  • An instance of the utils class providing utility methods and attributes from the discord.utils module. See class utils

Embed

  • A class representing an embed object for rich messages. See discord.Embed for details.

Permissions

  • A class representing Discord permissions. See discord.Permissions for details.

Colour

  • A class representing color values for embeds. See discord.Colour for details.

PermissionOverwrite

  • A class representing permission overwrites for channels. See discord.PermissionOverwrite for details.

AllowedMentions

  • A class representing allowed mentions settings for messages. See discord.AllowedMentions for details.

Object

  • A class representing a generic Discord object. See discord.Object for details.

HTTP Class Documentation

The http class provides attributes for managing HTTP routes, tokens, and sessions. This document outlines the features and usage of the http class.

Introduction

The http class offers attributes to manage HTTP-related settings and sessions.

Attributes

route

  • A placeholder attribute for managing HTTP routes. (Note: Specific usage and implementation are not provided in the documentation.)

token

  • A token string for authentication purposes.

session

  • A placeholder attribute for managing HTTP sessions. (Note: Specific usage and implementation are not provided in the documentation.)

Bot Class Documentation

The bot class represents a custom bot module with various attributes and methods for managing bot-related data and interactions. This document outlines the features and usage of the bot class.

Introduction

The bot class provides attributes and methods for managing bot-related data and actions.

Attributes

http

  • An instance of the http class, offering HTTP-related attributes and settings.

token

  • A token string for authentication purposes.

user

  • A string describing the bot user.

guilds

  • A list of guilds (servers) the bot is a member of.

emojis

  • A list of emojis available to the bot.

users

  • A list of users the bot can interact with.

channels

  • A list of channels the bot can interact with.

voice_clients

  • A list of voice clients managed by the bot.

Methods

get_db(key: str) -> str | int | None

  • Get a value from the database based on the provided key.

set_db(key: str, value: str | int) -> None

  • Set a value in the database with the provided key.

delete_db(key: str) -> None

  • Delete a value from the database based on the provided key.

update_db(key: str, value: str | int) -> None

  • Update a value in the database based on the provided key.

run() -> None

  • Placeholder method to run the bot. (Specific implementation details are not provided.)

start(*args, **kwargs) -> None

  • Placeholder asynchronous method to start the bot. (Specific implementation details are not provided.)
Clone this wiki locally