Compare commits
8 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
631b0fdb7e | |
|
|
924903f5e5 | |
|
|
617918d32d | |
|
|
ebe707ae26 | |
|
|
6dab4b64b0 | |
|
|
c7d12c25f4 | |
|
|
b2c821991d | |
|
|
841382df3d |
|
|
@ -1,4 +1,4 @@
|
||||||
# Group Up - An Event Scheduling Discord Bot | V1.1.3 - 2024/06/09
|
# Group Up - An Event Scheduling Discord Bot | V2.0.1 - 2024/12/24
|
||||||
[](https://sonarcloud.io/summary/new_code?id=GroupUp)
|
[](https://sonarcloud.io/summary/new_code?id=GroupUp)
|
||||||
[](https://sonarcloud.io/summary/new_code?id=GroupUp) [](https://sonarcloud.io/summary/new_code?id=GroupUp) [](https://sonarcloud.io/summary/new_code?id=GroupUp) [](https://sonarcloud.io/summary/new_code?id=GroupUp) [](https://sonarcloud.io/summary/new_code?id=GroupUp) [](https://sonarcloud.io/summary/new_code?id=GroupUp)
|
[](https://sonarcloud.io/summary/new_code?id=GroupUp) [](https://sonarcloud.io/summary/new_code?id=GroupUp) [](https://sonarcloud.io/summary/new_code?id=GroupUp) [](https://sonarcloud.io/summary/new_code?id=GroupUp) [](https://sonarcloud.io/summary/new_code?id=GroupUp) [](https://sonarcloud.io/summary/new_code?id=GroupUp)
|
||||||
|
|
||||||
|
|
@ -43,7 +43,12 @@ If you run into any errors or problems with the bot, or think you have a good id
|
||||||
---
|
---
|
||||||
|
|
||||||
## Self Hosting Group Up
|
## Self Hosting Group Up
|
||||||
Group Up is built on [Deno](https://deno.land/) `v1.33.1` using [Discordeno](https://discordeno.mod.land/) `v17.0.1`. If you choose to run this yourself, you will need to rename `config.example.ts` to `config.ts` and edit some values. You will need to create a new [Discord Application](https://discord.com/developers/applications) and copy the newly generated token into the `"token"` field. If you want to utilize some of the bots dev features, you will need to fill in the keys `"logChannel"` and `"reportChannel"` with text channel IDs and `"devServer"` with a guild ID.
|
Group Up is built on [Deno](https://deno.land/) using [Discordeno](https://discordeno.mod.land/) `v17.0.1`.
|
||||||
|
|
||||||
|
Group Up `V1.1.6` and lower requires Deno `V.33.1`.
|
||||||
|
Group Up `V2.0.0` and up requires Deno `V2.0.0`.
|
||||||
|
|
||||||
|
If you choose to run this yourself, you will need to rename `config.example.ts` to `config.ts` and edit some values. You will need to create a new [Discord Application](https://discord.com/developers/applications) and copy the newly generated token into the `"token"` field. If you want to utilize some of the bots dev features, you will need to fill in the keys `"logChannel"` and `"reportChannel"` with text channel IDs and `"devServer"` with a guild ID.
|
||||||
|
|
||||||
You will also need to install and setup a MySQL database with a user for the bot to use to add/modify the database. This user must have the `"DB Manager"` admin rights and `"REFERENCES"` Global Privileges. Once the DB is installed and a user is setup, run the provided `db\initialize.ts` to create the schema and tables. After this, run `db\populateDefaults.ts` to insert some needed values into the tables.
|
You will also need to install and setup a MySQL database with a user for the bot to use to add/modify the database. This user must have the `"DB Manager"` admin rights and `"REFERENCES"` Global Privileges. Once the DB is installed and a user is setup, run the provided `db\initialize.ts` to create the schema and tables. After this, run `db\populateDefaults.ts` to insert some needed values into the tables.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,41 +1,49 @@
|
||||||
export const config = { // !! NOTICE !! All fields below are required unless they are explicitly noted as OPTIONAL. If a field is OPTIONAL, do not remove it from this file, just leave it at the default value
|
export const config = {
|
||||||
'name': 'Group Up', // Name of the bot
|
// !! NOTICE !! All fields below are required unless they are explicitly noted as OPTIONAL. If a field is OPTIONAL, do not remove it from this file, just leave it at the default value
|
||||||
'version': '1.1.3', // Version of the bot
|
name: 'Group Up', // Name of the bot
|
||||||
'token': 'the_bot_token', // Discord API Token for this bot
|
version: '2.0.2', // Version of the bot
|
||||||
'localToken': 'local_testing_token', // Discord API Token for a secondary OPTIONAL testing bot, THIS SHOULD BE DIFFERENT FROM "token"
|
token: 'the_bot_token', // Discord API Token for this bot
|
||||||
'prefix': '/', // Prefix for all commands, as this bot uses slash commands, this needs to be '/'
|
localToken: 'local_testing_token', // Discord API Token for a secondary OPTIONAL testing bot, THIS SHOULD BE DIFFERENT FROM "token"
|
||||||
'db': { // Settings for the MySQL database, this is required to keep track of the currently active events.
|
prefix: '/', // Prefix for all commands, as this bot uses slash commands, this needs to be '/'
|
||||||
'host': '', // IP address for the db, usually localhost
|
db: {
|
||||||
'localhost': '', // IP address for a secondary OPTIONAL local testing DB, usually also is localhost, but depends on your dev environment
|
// Settings for the MySQL database, this is required to keep track of the currently active events.
|
||||||
'port': 3306, // Port for the db
|
host: '', // IP address for the db, usually localhost
|
||||||
'username': '', // Username for the account that will access your DB, this account will need "DB Manager" admin rights and "REFERENCES" Global Privileges
|
localhost: '', // IP address for a secondary OPTIONAL local testing DB, usually also is localhost, but depends on your dev environment
|
||||||
'password': '', // Password for the account, user account may need to be authenticated with the "Standard" Authentication Type if this does not work out of the box
|
port: 3306, // Port for the db
|
||||||
'name': '', // Name of the database Schema to use for the bot
|
username: '', // Username for the account that will access your DB, this account will need "DB Manager" admin rights and "REFERENCES" Global Privileges
|
||||||
|
password: '', // Password for the account, user account may need to be authenticated with the "Standard" Authentication Type if this does not work out of the box
|
||||||
|
name: '', // Name of the database Schema to use for the bot
|
||||||
},
|
},
|
||||||
'links': { // Links to various sites
|
links: {
|
||||||
'sourceCode': 'https://github.com/Burn-E99/GroupUp', // Link to the repository, OPTIONAL
|
// Links to various sites
|
||||||
'supportServer': '', // Invite link to the Discord support server, OPTIONAL
|
sourceCode: 'https://github.com/Burn-E99/GroupUp', // Link to the repository, OPTIONAL
|
||||||
'addToCalendar': '', // Link to where the icsGenerator is hosted, OPTIONAL
|
supportServer: '', // Invite link to the Discord support server, OPTIONAL
|
||||||
'creatorIcon': '', // Link to where the GroupUpSinglePerson.png (or similar image) is hosted
|
addToCalendar: '', // Link to where the icsGenerator is hosted, OPTIONAL
|
||||||
|
creatorIcon: '', // Link to where the GroupUpSinglePerson.png (or similar image) is hosted
|
||||||
},
|
},
|
||||||
'defaultDateFormat': 'MONTH/DAY/YEAR', // Default format that Group Up will suggest to the user. Must match one of the options in the 'DateTimeFormats' enum inside 'src/buttons/event-creation/dateTimeUtils.ts'
|
defaultDateFormat: 'MONTH/DAY/YEAR', // Default format that Group Up will suggest to the user. Must match one of the options in the 'DateTimeFormats' enum inside 'src/buttons/event-creation/dateTimeUtils.ts'
|
||||||
'logChannel': 0n, // Discord channel ID where the bot should put startup messages and other error messages needed, OPTIONAL
|
logChannel: 0n, // Discord channel ID where the bot should put startup messages and other error messages needed. This value is a bigint, so please ensure you have a `n` after the ID you get from Discord. OPTIONAL
|
||||||
'reportChannel': 0n, // Discord channel ID where reports will be sent when using the built-in report command, OPTIONAL
|
reportChannel: 0n, // Discord channel ID where reports will be sent when using the built-in report command. This value is a bigint, so please ensure you have a `n` after the ID you get from Discord. OPTIONAL
|
||||||
'devServer': 0n, // Discord guild ID where testing of indev features/commands will be handled, used in conjunction with the DEVMODE bool in mod.ts, OPTIONAL
|
devServer: 0n, // Discord guild ID where testing of indev features/commands will be handled, used in conjunction with the DEVMODE bool in mod.ts. This value is a bigint, so please ensure you have a `n` after the ID you get from Discord. OPTIONAL
|
||||||
'owner': 0n, // Discord user ID of the bot admin
|
owner: 0n, // Discord user ID of the bot admin. This value is a bigint, so please ensure you have a `n` after the ID you get from Discord.
|
||||||
'botLists': [ // Array of objects containing all bot lists that stats should be posted to, OPTIONAL
|
botLists: [
|
||||||
{ // Bot List object, duplicate for each bot list
|
// Array of objects containing all bot lists that stats should be posted to, OPTIONAL
|
||||||
'name': 'Bot List Name', // Name of bot list, not used
|
{
|
||||||
'enabled': false, // Should statistics be posted to this list?
|
// Bot List object, duplicate for each bot list
|
||||||
'apiUrl': 'https://example.com/api/bots/?{bot_id}/stats', // API URL, use ?{bot_id} in place of the bot id so that it can be dynamically replaced
|
name: 'Bot List Name', // Name of bot list, not used
|
||||||
'headers': [ // Array of headers that need to be added to the request
|
enabled: false, // Should statistics be posted to this list?
|
||||||
{ // Header Object, duplicate for every header needed
|
apiUrl: 'https://example.com/api/bots/?{bot_id}/stats', // API URL, use ?{bot_id} in place of the bot id so that it can be dynamically replaced
|
||||||
'header': 'header_name', // Name of header needed, usually Authorization is needed
|
headers: [
|
||||||
'value': 'header_value', // Value for the header
|
// Array of headers that need to be added to the request
|
||||||
|
{
|
||||||
|
// Header Object, duplicate for every header needed
|
||||||
|
header: 'header_name', // Name of header needed, usually Authorization is needed
|
||||||
|
value: 'header_value', // Value for the header
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
'body': { // Data payload to send to the bot list, will be turned into a string and any ?{} will be replaced with the required value, currently only has ?{server_count}
|
body: {
|
||||||
'param_name': '?{param_value}', // Add more params as needed
|
// Data payload to send to the bot list, will be turned into a string and any ?{} will be replaced with the required value, currently only has ?{server_count}
|
||||||
|
param_name: '?{param_value}', // Add more params as needed
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
||||||
35
deno.json
35
deno.json
|
|
@ -1,42 +1,19 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"allowJs": true,
|
"lib": ["deno.window"],
|
||||||
"lib": [
|
|
||||||
"deno.window"
|
|
||||||
],
|
|
||||||
"strict": true
|
"strict": true
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"files": {
|
"include": ["src/", "db/", "mod.ts", "deps.ts", "config.ts", "config.example.ts"],
|
||||||
"include": [
|
"exclude": [],
|
||||||
"src/",
|
|
||||||
"db/",
|
|
||||||
"mod.ts",
|
|
||||||
"deps.ts",
|
|
||||||
"config.ts",
|
|
||||||
"config.example.ts"
|
|
||||||
],
|
|
||||||
"exclude": []
|
|
||||||
},
|
|
||||||
"rules": {
|
"rules": {
|
||||||
"tags": [
|
"tags": ["recommended"],
|
||||||
"recommended"
|
"include": ["ban-untagged-todo"],
|
||||||
],
|
|
||||||
"include": [
|
|
||||||
"ban-untagged-todo"
|
|
||||||
],
|
|
||||||
"exclude": []
|
"exclude": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"fmt": {
|
"fmt": {
|
||||||
"include": [
|
"include": ["src/", "db/", "mod.ts", "deps.ts", "config.ts", "config.example.ts"],
|
||||||
"src/",
|
|
||||||
"db/",
|
|
||||||
"mod.ts",
|
|
||||||
"deps.ts",
|
|
||||||
"config.ts",
|
|
||||||
"config.example.ts"
|
|
||||||
],
|
|
||||||
"exclude": [],
|
"exclude": [],
|
||||||
"useTabs": true,
|
"useTabs": true,
|
||||||
"lineWidth": 200,
|
"lineWidth": 200,
|
||||||
|
|
|
||||||
2
deps.ts
2
deps.ts
|
|
@ -47,4 +47,4 @@ export type {
|
||||||
|
|
||||||
export { Client } from 'https://deno.land/x/mysql@v2.11.0/mod.ts';
|
export { Client } from 'https://deno.land/x/mysql@v2.11.0/mod.ts';
|
||||||
|
|
||||||
export { initLog, log, LogTypes as LT } from 'https://raw.githubusercontent.com/Burn-E99/Log4Deno/V1.1.0/mod.ts';
|
export { initLog, log, LogTypes as LT } from 'https://raw.githubusercontent.com/Burn-E99/Log4Deno/V2.0.0/mod.ts';
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,14 @@ export const Activities: Array<Activity> = [
|
||||||
{
|
{
|
||||||
name: 'Raids',
|
name: 'Raids',
|
||||||
options: [
|
options: [
|
||||||
|
{
|
||||||
|
name: 'The Desert Perpetual (Epic)',
|
||||||
|
maxMembers: 6,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'The Desert Perpetual',
|
||||||
|
maxMembers: 6,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "Salvation's Edge",
|
name: "Salvation's Edge",
|
||||||
maxMembers: 6,
|
maxMembers: 6,
|
||||||
|
|
@ -56,6 +64,18 @@ export const Activities: Array<Activity> = [
|
||||||
{
|
{
|
||||||
name: 'Dungeons',
|
name: 'Dungeons',
|
||||||
options: [
|
options: [
|
||||||
|
{
|
||||||
|
name: 'Equilibrium',
|
||||||
|
maxMembers: 3,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Sundered Doctrine',
|
||||||
|
maxMembers: 3,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Vesper's Host",
|
||||||
|
maxMembers: 3,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "Warlord's Ruin",
|
name: "Warlord's Ruin",
|
||||||
maxMembers: 3,
|
maxMembers: 3,
|
||||||
|
|
@ -177,6 +197,10 @@ export const Activities: Array<Activity> = [
|
||||||
{
|
{
|
||||||
name: 'Miscellaneous/Seasonal',
|
name: 'Miscellaneous/Seasonal',
|
||||||
options: [
|
options: [
|
||||||
|
{
|
||||||
|
name: 'Excision',
|
||||||
|
maxMembers: 12,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'Pantheon',
|
name: 'Pantheon',
|
||||||
options: [
|
options: [
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,12 @@ export const alternateEventBtnStr = 'Join as Alternate';
|
||||||
export const noDescProvided = 'No description provided.';
|
export const noDescProvided = 'No description provided.';
|
||||||
|
|
||||||
// Member List generators
|
// Member List generators
|
||||||
|
const escapeMemberNameForDisplay = (memberName: string): string => memberName.replaceAll('\\', '').replaceAll('_', '\\_');
|
||||||
export const generateMemberTitle = (memberList: Array<LFGMember>, maxMembers: number): string => `Members Joined: ${memberList.length}/${maxMembers}`;
|
export const generateMemberTitle = (memberList: Array<LFGMember>, maxMembers: number): string => `Members Joined: ${memberList.length}/${maxMembers}`;
|
||||||
export const generateMemberList = (memberList: Array<LFGMember>): string => memberList.length ? memberList.map((member) => `${member.name} - <@${member.id}>`).join('\n') : noMembersStr;
|
export const generateMemberList = (memberList: Array<LFGMember>): string =>
|
||||||
|
memberList.length ? memberList.map((member) => `${escapeMemberNameForDisplay(member.name)} - <@${member.id}>`).join('\n') : noMembersStr;
|
||||||
export const generateAlternateList = (alternateList: Array<LFGMember>): string =>
|
export const generateAlternateList = (alternateList: Array<LFGMember>): string =>
|
||||||
alternateList.length ? alternateList.map((member) => `${member.name} - <@${member.id}>${member.joined ? ' *' : ''}`).join('\n') : noMembersStr;
|
alternateList.length ? alternateList.map((member) => `${escapeMemberNameForDisplay(member.name)} - <@${member.id}>${member.joined ? ' *' : ''}`).join('\n') : noMembersStr;
|
||||||
|
|
||||||
// Fields for event creation and editing modals
|
// Fields for event creation and editing modals
|
||||||
export const eventTimeId = 'eventTime';
|
export const eventTimeId = 'eventTime';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue