Package: aho
ahoGeneral purpose Discord bot.InstallationRequirementspython3 (>=3.11.2) with pipvirtualenvClone and install in virtualenvgit clone git@gitlab.com:nul.one/aho.gitcd ahosetup and enable virtualenv with correct version of pythonpip install ./ahoInstall from pypipip install ahoNote that running aho bot will create a socket file in current directory.Usageaho --help- show available commandsaho run --help- show options for runningYou can run the bot with these minimal options:aho run -t DISCORD_AUTHORIZATION_TOKEN --database SQLITE_DB_FILE_PATHAdditional run options and environment variblesEach of these variables can be set using corresponding env variable. If both command line option and env variable are present, the command line option will be used.-t, --tokenor exportTOKENDiscord bot authorization token.-o, --owneror exportOWNERBot owner (dev) Discord user ID.--databasePath to sqlite database file. If not provided, it will use ephemeral database in ram.--prefixor exportDEFAULT_PREFIXDefault prefix in guilds. Each guild prefix can be configured in the guild itself.--descriptionor exportBOT_DESCRIPTIONBot description that shows up in guild commands help printout.-n, --nameor exportBOT_NAMEBot name that shows up in guild commands help printout.--openaior exportOPENAI_API_KEYOpenAI API secret key.--openai-system-messageor exportOPENAI_SYSTEM_MESSAGEDefault ChatGPT system message if you want to customize it.-l, --log-fileLog file path.FeaturesThese are the features as used from Discord. All of these should start with a bot prefix (default isaho) specific for each guild.MetadataMetadata is a list of key/value pairs associated with either a guild, channel, user or member. You can create any key/value pair. Some specific keys are used by other extensions and features. Having an unrestricted key/value pair simplifies configuration of existing features or adding new features in the future.Here is a list of commands for manipulating metadata:meta (guild|CHANNEL_TAG|MEMBER_TAG) (get|set) KEY [VALUE]This will get the value of a key for selected entity or set the new value.The guild as an entity is just a literal word "guild" or "g" for short. There is no tag for a guild. E.g.meta g set prefix ~.If you want to delete a key/value entry, use set command without the value. E.g.meta g set openai_api_key.To list keys/vlues, omit key when getting. E.g.meta #general get.User metaThis is separate command to manipulate user specific metadata as opposed to a member. Member is user entity tied to a guild. User metadata is same across all guilds for a specific user. As such, this command is restricted to a bot owner (see--owneroption in instructions on how to run the bot).The command is similar to howmetaworks:umeta (MEMBER_TAG|DISCORD_USER_ID) (get|set) KEY [VALUE]Moderation commandsThese commands are used for user/channel/guild moderation and are available to users with those specific permissions.ban (MEMEBER_TAG|DISCORD_USER_ID) [REASON]ban a user.unban (MEMEBER_TAG|DISCORD_USER_ID)lift a user ban.kick (MEMEBER_TAG|DISCORD_USER_ID) [REASON]kick a user from guild.perms (MEMEBER_TAG|DISCORD_USER_ID)display member permissions in guild.clear [N]delete N lines (defaults to 1) right above in the current channel.OpenAI (ChatGPT) chatThere are 2 modes of chatting with ChatGPT bot: using chat command and using a chat specific channel. ChatGPT 3.5 is being used as of the time of writing this manual.Chat commandGuild level metadata values should be configured:openai_api_keyPut your OpenAI API key here. Alternatively, you can specify this value when running the bot with--openaioption or exportingOPENAI_API_KEYenvironment variable. Note that by doing so the api will be enabled by default on all guilds. I recommend having a specific setting in metadata for each guild if your discord bot is publically available.openai_system_messageThis is optional and is used if you want to customize your ChatGPT experience.Using achatcommand, e.g.chat Hello! Can you tell me the radius of Earth?will initiate a respons from the bot in all channels.Chat channelYou can configure one channel that will always initiate a response from a bot, no commands need to be used in it. To configure a channel for this, set these meta variables at the channel level:openai_chat_enabledSet it to1to start using this channel as dedicated for a chatbot interraction.openai_system_messageOptional, same as forchatcommand. Each dedicated channel can have specific ChatGPT customization.You still need anopenai_api_keyset at the guild level for this dedicated channel chat to work.PointsMembers who have permission to manage other members can use the point system. Point system is used to award other members for any deeds or to promote competitive environment. It's up to you on how you will use this feature.transaction (MEMBER_TAG|DISCORD_USER_ID) AMOUNT [DESCRIPTION]Add (or remove by adding negative AMOUNT) points to a member.Points can be visible in the member info (see info command).Member InfoUse this command to see following information about a member:number of pointsguild joining date and joining positionguild rolesdiscord account creation dateUse it as soinfoIf you don't provide a member tag or ID, it will show your own info.RollRoll dice in NdN format, first number being number of dice and second being number of sides on each die.roll [NdN]Default is 1d6 which you can use without arguments.Emojiaddemoji EMOJI NAMECopy an existing emoji (that you can access from another server with Discord premium) and add it to the current server under a new NAME.getemoji EMOJIGet a link to the emoji image or animation.General purpose commandshelp [command]Show usage of specific command. If you don't specify a command, it will list all commands with short description.avatar [MEMBER_TAG|DISCORD_USER_ID]It will reply with a member avatar image. If you don't provide a member tag or ID, it will show your own avatar.embed "Some Title" Some message.This will create an embeded message in a current channel and delete your command message. Used to create emphasized messages.info [MEMBER_TAG|DISCORD_USER_ID]Show member info, including number of points, guild joining date and position, guild roles and discord account creation date. If you don't specify a member, your own info will be shown.prefix NEW_PREFIXSet new Discord bot prefix at a guild level.versionDisplay the current bot version.Versioning and compatibilityStarting from version1.3.0the versions will followSemantic versioning v2.0.0.License3-Clause BSD Licensewhich you can see in the LICENSE file.