Skip to content

announcements_and_opsec

test edited this page Aug 14, 2024 · 17 revisions

This bot has tools for bulk communication, and for tracking leaks.

  • Bulk mail players using placeholders for names and other nation attributes
  • Create announcements, in-game mail, discord embeds, direct messages and invites that are unique to each user
  • Use Optical Character Recognition (OCR) to parse screenshots,
  • Search for matching or similar messages or invites

Prerequisite settings

Set your alliance and api key

📚 Your alliance id
/settings_default registeralliance

Your alliance id

Arguments:

<alliances> - Set
A comma separated list of alliances


📚 API key found at the bottom of: https://politicsandwar.com/account/...
/settings_default registerapikey

API key found at the bottom of: https://politicsandwar.com/account/
Be sure to enable all access you wish the bot to have, and have a sufficient position in-game (e.g. leader)
Needed for alliance functions and information access, such as calculating resource dispersal, sending mail
Api Key Example

Arguments:

<apiKeys> - List[TextArea]
Multiple words or text separated by spaces
Use quotes for multi-word arguments


Set a role for who can use the mail commands

/role setalias locutusrole: MAIL discordrole: @discordRole

Bulk mail

📚 Send in-game mail to a list of nations...
/mail send

Send in-game mail to a list of nations
Supports subject and body nation placeholders
See: https://github.com/xdnw/locutus/wiki/nation_placeholders
Append the channel id to the subject to direct responses there:
Hello Nation/12345678910
(Note: DM Borg to setup mail responses)

Arguments:

<nations> - Set
A comma separated list of nations, alliances and filters
<subject> - String
A single line of text
<message> - String[TextArea]
[-f force] - boolean
[-l sendFromGuildAccount] - boolean
Send from the api key registered to the guild
[-a apiKey] - String
The api key to use to send the mail
(A single line of text)


Reply to messages

📚 Reply to an in-game mail message...
/mail reply

Reply to an in-game mail message
Supports subject and body nation placeholders
See: https://github.com/xdnw/locutus/wiki/nation_placeholders

Arguments:

<receiver> - DBNation
The nation you are replying to
(nation id, name or url)
<url> - String
The url of the mail
(A single line of text)
<message> - String
A single line of text
[-s sender] - DBNation
The account to reply with
Must be the same account that received the mail
(nation id, name or url)


Mail command results

📚 Bulk send the result of a bot command to a list of nations in your alliance...
/mail command

Bulk send the result of a bot command to a list of nations in your alliance
The command will run as each user
Nations which are not registered or lack permission to use a command will result in an error
It is recommended to review the output sheet before confirming and sending the results

Arguments:

<nations> - Set
Nations to mail command results to
(A comma separated list of nations, alliances and filters)
<subject> - String
A single line of text
<command> - String
The locutus command to run
(A single line of text)
<body> - String[TextArea]
Message to send along with the command result
(A single line of text)
[-s sheet] - SpreadSheet
A google spreadsheet id or url
For shorthand, use a comma when specifying the sheet tab e.g. sheet:ID,TAB_NAMEFor a url, append #gid=1234 or #tab=tabName to specify the id of the tab to use
[-d sendDM] - boolean
Send as a discord direct message
[-m skipMail] - boolean
Skip sending in-game mail
(only valid if sendDM is true)


Mail a google spreadsheet

📚 Bulk send in-game mail from a google sheet...
/mail sheet

Bulk send in-game mail from a google sheet
Columns: nation, subject, body
Other bulk mail commands forward to this command

Arguments:

<sheet> - SpreadSheet
A google spreadsheet id or url
For shorthand, use a comma when specifying the sheet tab e.g. sheet:ID,TAB_NAMEFor a url, append #gid=1234 or #tab=tabName to specify the id of the tab to use
[-f force] - boolean
[-d dm] - boolean
[-m skipMail] - boolean


Sending unique announcements

Supports sending dms, mail and clickable discord embeds

📚 Send an announcement to multiple nations, with random variations for each receiver
/announcement create

Send an announcement to multiple nations, with random variations for each receiver

Arguments:

<sendTo> - NationList
A comma separated list of nations, alliances and filters
<subject> - String
The subject used for sending an in-game mail if a discord direct message fails
(A single line of text)
<announcement> - String[TextArea]
The message you want to send
(A single line of text)
<replacements> - String[TextArea]
Lines of replacement words or phrases, separated by | for each variation
Add multiple lines for each replacement you want
You can use \n for newline for discord slash commands
(A single line of text)
[-c channel] - MessageChannel
The channel to post the announcement to (must be same server)
(A discord channel name or mention)
[-b bottomText] - String
The text to post in the channel below the hidden announcement (e.g. mentions)
(A single line of text)
[-v requiredVariation=0] - Integer
The required number of differences between each message
(A whole number)
[-r requiredDepth=0] - Integer
The required depth of changes from the original message
(A whole number)
[-s seed] - Long
Variation seed. The same seed will produce the same variations, otherwise results are random
(A whole number)
[-m sendMail] - boolean
If messages are sent in-game
[-d sendDM] - boolean
If messages are sent via discord direct message
[-f force] - boolean


Sending unique invites

Note: Recommended to use allowCreation

📚 Create, send and record unique invites to a set of nations...
/announcement invite

Create, send and record unique invites to a set of nations
The invite can be sent via discord direct message, mail, viewed from an embed, or command
If allowCreation is not enabled, only a single invite will be created per nation; invites may expire and no new invites are permitted.

Arguments:

<message> - String
A single line of text
<inviteTo> - Guild
A discord guild id. See: https://en.wikipedia.org/wiki/Template:Discord_server#Getting_Guild_ID
[sendTo] - NationList
A comma separated list of nations, alliances and filters
[-e expire] - Long[Timediff]
A time difference or unix timestamp which will resolve as a difference relative to the current date
[-u maxUsesEach] - Integer
A whole number
[-d sendDM] - boolean
Send the invite via discord direct message
[-m sendMail] - boolean
[-c allowCreation] - boolean
Allow creating an invite when any nation matches sendTo, when they don't already have an invite, or theirs has expired
Invites can be created by using viewing the announcement embed or running the announcement view command
Defaults to false
[-f force] - boolean


Sending unique documents

📚 Create an embed to view a google document for multiple nations, with random variations for each receiver
/announcement document

Create an embed to view a google document for multiple nations, with random variations for each receiver

Arguments:

<original> - GoogleDoc
A google document id or url
<sendTo> - NationList
A comma separated list of nations, alliances and filters
<replacements> - String[TextArea]
Lines of replacement words or phrases, separated by | for each variation
Add multiple lines for each replacement you want
(A single line of text)


Sending unique polls

Create a new spreadsheet, then add the following google app script:

App-Script Tutorial: https://www.benlcollins.com/apps-script/google-apps-script-beginner-guide/

How to use this script:

  • Edit the title and replacements in the your script file (typically Code.gs)
  • Add your nations to the nations tab
  • Add your questions to the questions tab. See the Set Example Questions from the Poll menu. Refresh the page if you dont see the menu.
  • Press the Create Polls button from the Poll menu
  • View the created polls in the nations tab
  • To send the polls via in-game mail, see the /mail sheet command

Note: Polls will not be created if one already exists in the nations tab

Converting a screenshot to text

📚 Get the text from a discord image...
/announcement ocr

Get the text from a discord image
It is recommended to crop the image first

Arguments:

<discordImageUrl> - String
A single line of text


Finding a nation from a message or invite

📚 Find the announcement closest matching a message
/announcement find

Find the announcement closest matching a message

Arguments:

<announcementId> - int
A whole number
<message> - String
A single line of text


📚 Find the announcement for the closest matching invite
/announcement find_invite

Find the announcement for the closest matching invite

Arguments:

<invite> - String
A single line of text


Other announcement commands

📚 Set the archive status of the bot's announcement
/announcement archive

Set the archive status of the bot's announcement

Arguments:

<announcementId> - int
A whole number
[archive] - Boolean


📚 Mark an announcement by the bot as read/unread
/announcement read

Mark an announcement by the bot as read/unread

Arguments:

<ann_id> - int
A whole number
[markRead] - Boolean


📚 View an announcement you have access to
/announcement view

View an announcement you have access to

Arguments:

<ann_id> - int
A whole number
[-d document] - boolean
[-n nation] - DBNation
nation id, name or url


Clone this wiki locally