What is GuildBot?
GuildBot allows your members to update their data inside Discord. They don’t even need access to your Spreadsheet, GuildBot will manage it for you. So you can make your sheet fully private, for e.g. only officers are able to read and write the sheet – and members can update their data via Discord (Not always the usecase, but i know some guilds that would love this).
And we also all know: People are lazy. So with a single oneliner in Discord, a tool which your members already use, they’re able to update their data immediatly. Feel free to use GuildBot!
Use help
Very first thing to know – the help commands will provide you always with basic explanations on how to use the bot.
Just use
!help or !helpNew
I’m not sure yet, which one i like more, so i left both of this helps in 😉
Configure GuildBot with your Discord
When GuildBot joined your Discord Server, you’ve to configure him.
I suggest that you follow this order, but for the bot itself it doesn’t matter.
Configure Roles
The admin of your discord server should add the roles, that are allowed to configure the GuildBot, for e.g. your officers. For this you just have to write:
!config role admin add @Rolename1 @Rolename2 … @RolenameN
Note: Roles have to have the „Allow everyone to mention this role“ setting in discord – otherwise you can’t add them to the bot. You can remove this Role setting afterwards.
You can add as much roles as you want, in any order you want. The given roles are now allowed to use the !config commands as well.
Now add your Member Roles. I know alot of Guilds who has a public area, and a private area. And you don’t want to allow non-members to use the bot. So the command is quite similar:
!config role member add @Rolename1 @Rolename2 … @RolenameN
Here again: it doesn’t matter in which order you write the roles, nor does it matter if you duplicate roles. The Bot will handle itself. Only the selected roles will be able to use the bot.
Short note: Adminroles are automatically added to the list of member roles.
You can always check the configured roles by
!config role admin/member list
GuildBot will show you which roles he has saved for your server.
Configure Channel(s)
For sure you want to limit GuildBot to one or more specific text channels. You can add them easily via
!config channel add #textchannel1 #textchannel2 …. #textchannelN
If you gave GuildBot the permission to manage channels inside your discord server, then he will automatically create the given textchannels. If not, you have to create this textchannels in advance.
Listing here works the same as in role command:
!config channel list
Create Sheet
Now follows the most interesting and probably the most difficult part: How to configure your spreadsheet that GuildBot can use it.
If you don’t have a spreadsheet yet, or just want a fresh start of your spreadsheet, you can use
!config sheet create
GuildBot will then create a new blank sheet and will link it to you . Nearly blank. Guildbot will automatically add the very first Column to the sheet and auto-configure it: DiscordID
This is very important, because GuildBot later needs to know which of your members is which Member inside the sheet. To archive this, we need the Discord User ID inside our sheet.
If GuildBot has already a sheet configured for your Guild, you can use the same command, and Guildbot will clone your current sheet to a new link, and deletes the old sheet, too. This is important, in case you removed/lost guild members, and want to use a new sheetlink that the non members can’t use your sheet anymore.
Also note: You can set the sheet to private if you want, for e.g. if you know how to work with spreadsheet permissions, feel free to change them and make your sheet private. If GuildBot created the sheet for you, he will stay the owner of the sheet.
If you already own a sheet, you can use this as well. But before you have to give permission to GuildBot to your sheet, even if it’s a public sheet. This is a Google API Limitation, and GuildBot is a service Account – he needs to know specific which sheets he can access.
Just share your sheet with this email adress:
pm-bot@panicmode-1379.iam.gserviceaccount.com
After that you can use the sheet update command to set your sheetid to GuildBot. To get your sheetid you can use your sheetlink, for e.g. if you’ve this link:
https://docs.google.com/spreadsheets/d/1pIQIe1gbgrG8f0INJ6_hLmIySFiP4Qe6ohFC28XnQv8/edit
The bold-orange part is your sheet id. So then we’ll use
!config sheet update 1pIQIe1gbgrG8f0INJ6_hLmIySFiP4Qe6ohFC28XnQv8
Important note: If you use your own sheet: Please rename your Worksheet (the small tab on the bottom) for initial use to „Member Management“ – After that, you can rename the sheet with the rename command via Guildbot (See command details below)
But, for GuildBot to work, you’ve to also add the DiscordID field manually. I suggest you add a Column before your very first one, so that column A is free now. Then use this command, to add DiscordID to your sheet and GuildBot sheet config:
!config sheet field DiscordID:int:0:A
I will explain this command in the next step.
Now you’ve a working sheet for your Guild. Now follows the finetuning, because our sheet is quite empty, right?
Configure Sheet
For the usage of members updating their data, GuildBot has to know about the fields inside your Sheet. For this is the config sheet fields command
!config sheet field add/rm/remove fieldName[:fieldType:fieldDefaultValue:fieldColumn]
- fieldName: Name/Title of your field
- fieldType: „int“ or „string“ – atm not used, but will be used later
- fieldDefaultValue: Here you can define a number or string, that will be autofilled from GuildBot, when you add Members to the sheet via GuildBot
- fieldColumn: A, B, C…..ZZ – You can manually define the column inside the sheet with this definition. Or you can not configure it, then GuildBot will search for the very next free column inside your sheet, and add the field there.
Only fieldName is mandatory, all other field definitions are optional. But when you want to use them, use them in this specific order.
Important: fieldName and fieldDefaultValue cannot contain spaces. This is a technical limitation from the bot itself. Spaces are separated into commands/subcommands, so spaces are not allowed here. Use _ or – instead.
Important: if you define fieldColumn, and your sheet already contains this column, GuildBot will overwrite this column title. GuildBot ignores the Values, but rewrites the Cell itself – in case you wonder.
So, now that we know how to use this command, let’s add some basic information for members to the sheet:
!config sheet field add FirstName
[…]
!config sheet field add LastName
!config sheet field add Class:int:0
!config sheet field add Level:int:0
You can add as much fields as you need to your sheet. Feel free.
Good to know: You can also add fields manually to your sheet, for e.g. some calculation Columns, extra Info, etc. As long as you don’t configure them via GuildBot, Guildbot will completely ignore these fields on your Sheet. GuildBot will only manage his very own configured fields.
For a list of configured fields you can use
!config sheet field list
If you want to remove a field from the GuildBot config, u can use
!config sheet field rm fieldName
The sheet itself will not change, the data will still be there. GuildBot is just not using this field anymore.
Todo/important: Update field command is not yet implemented, will follow in one of the next releases. So for the moment: Don’t manually move the columns around – Guildbot will then just fail to find specific fields inside your sheet.
Rename Sheet/Worksheet
Per Default GuildBot will name your sheet with your Discord Server Name + “ Sheet“, as well as it renames the first worksheet (tab) to „Member Management“. But you’re free to rename it to whatever you want.
!config sheet rename sheet New Sheet Title
or
!config sheet rename worksheet New Worksheet/Tab Title
Add/Remove Members
Now that you’ve some fields configured, you can start to add Members to your sheet, just use:
!member add @User1 @User2 @User3 …. @UserN
Add as much members as you want in one task. Guildbot will check for duplicates and ignore them, also Guildbot will not add members who are already in your sheet.
You can add your members manually, too. Just copy/paste the UserID from discord into Column A: DiscordID. This way you can use your already filled Spreadsheet and add the GuildBot functionality to it.
If you want to remove members, it works the same
!member rm @User1 @User2 @User3 …. @UserN
When you remove a Member from your sheet, Discord will blank all GuildBot-configured fields – the rest of the fields stays in your sheet. You need to cleanup them manually.
Only Members with a given DiscordID in the sheet will be able to use the !update command
Reminder Command
The reminder command will remind some slacker to fill out his/her field values:
!reminder filedName
Guildbot will highlight all users who didn’t fill up this selected field, or it’s just filled with the default Value.
Example:
!reminder Thursday
Will highlight every Member of your Sheet which didn’t fill out the field Thursday!
Get Sheet Link
Just use
!sheet
Guildbot will give you your actual sheet.
Update Command
This is the part where your members needs to read.
Start with
!help update
It will print you all your possible fields, that you fill with data.
For the update to use, just use this syntax:
!update fieldName1:Value1 fieldName2:Value2 fieldName3:Value3 …. fieldNameN:ValueN
It doesn’t matter in which order, it doesn’t matter if you add all fields or just one, it doesn’t matter if the fieldname is upper or lowercase. GuildBot will only update the fields you told him and will map them.
Important: No Spaces inside Values! This is a technical limitation. Use _ or – instead
Example:
!update firstName:Flooki lastName:Best_Wiz_Eu Class:Wizard LVL:60
Done!
TodoList
Queue for Broadcasting from DBInvitable Bot – !guildbotadd/RM Discord Server to DB on join/leave Discord ServerCreate Relational DB to store guild sheet configsadd debug outputadd Monolog Logger with correct LogfilesInstall as a service on serverLogrotate on server- Configurable prefix maybe? default is „!“ – maybe then change default to @GuildBot
refactored commands to commands with subcommandsrefactored help usage for subcommands to userefactor help messages to embeds:Try !helpNewwrite docrefactor into sub classes- Add try/catch Blocks around all commands
Configuration:
create spreadsheet – !config sheet createwill create new spreadsheet – if we already have one, duplicate it, and print the new linkdelete the old sheet, if we copied it to a new one
update spreadsheet – !config sheet updaterenaming of sheets and worksheets – !config sheet rename sheet/worksheetconfigurable spreadsheet – !config sheet field add/rm|remove < field>:< fieldType>:< fieldDefault>:< fieldRow>check for duplicated entries / don’t allow them, throw an error if trying to add duplicate- add update fields command
Bug in finding first free cell during !config sheet field add
config channels – !config channel add/rm|remove < #channel>- permission check if guildbot can read/write in that channel
permission check for admins only usage of !configconfig roles – !config role admin/member add/rm|remove < @role1> < @role2>- Bug: Role IDs differ from stored ones?!
add „list“ commandsadd config cleanup commandTodo: clean botchannel if active- Think about how to manage 2 Guilds inside one Discord Server (for e.g. Mainguild and „slacker“ guild)
Bug: When using !config sheet update – add to documentation that the worksheet title has to be „Member Management“ by default- Bug: Throw an error message when Worksheet name could not be found
Bug: Throw error when !config sheet field add is emptyBug: !config sheet update with sheetid containing underscore (discord is making the text italy then)Add to doc that @roles have to be mentionable to be added / removed via !config role add/rm command- Bug: everything related to fields: When trying for e.g. to member add – and someone renamed the field in the sheet, throw an error that Guildbot can’t find the field anymore
Guild Management:
member management – !member add/rm|remove < @highlight> < @highlight2> … < @highlightN>- When adding member to sheet, also grant access to configured memberrole – will not add, memberroles includes adminroles, and we don’t want to give every member admin role, right
member updating – !update/upd < field>:< value1> < field2>:< value2> …. < fieldN>:< valueN>return sheet link – !sheet- Bug: Missing message when member not found
- Bug: Bot dies when updating too much fields, api limitation?
- Bug: Use types when filling data, for e.g. not allow strings when integer is configured type
Add a command to remind members to fillup / update their datafor e.g. !reminder fieldName – and GuildBot will check which member has filled data in this field and remind them to fill up
- Add a command to insert blank lines, for e.g. just add a row with some values with configured fields
- Add the possibility to add spaces as values during update
Credits
Ty Bogdan#4205 for Alphatesting and giving me ideas!
Icons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY
Leave A Comment
You must be logged in to post a comment.