Werewolf for Telegram
This is the main repo for Werewolf for Telegram.
For language file updates, please submit the xml file on Telegram to the support chat and ask for assistance
To set up werewolf on a private server, follow these steps:
Go to BotFather and create a new bot. Answer all of the questions it asks, and you will receive an API Token.
HKLM\SOFTWARE\
, create a new Key named Werewolf
(HKLM - HKEY_LOCAL_MACHINE)ProductionAPI
.Grab the werewolf.sql file from this repository
werewolf
database and all the tables / views / stored procs to go with itdbo.Admin
table
Now it's time to compile the source code
Werewolf
key create a new string value named BotConnectionString
.metadata=res://*/WerewolfModel.csdl|res://*/WerewolfModel.ssdl|res://*/WerewolfModel.msl;provider=System.Data.SqlClient;provider connection string="data source=SERVERADDRESS;initial catalog=werewolf;user id=USERNAME;password=PASSWORD;MultipleActiveResultSets=True;App=EntityFramework"
RELEASE
build. You may want to go into Werewolf_Control.Helpers.UpdateHelper.cs
and add your id to internal static int[] Devs = { ... }
. Also, double check the Settings.cs
files in both Werewolf Control/Helpers
and Werewolf Node/Helpers
.Server directories
Directory | Contents |
---|---|
root\Instance Name\Control |
Control build |
root\Instance Name\Node 1 |
Node build |
root\Instance Name\Node <#> |
Node updates can be added to a new Node folder. Running /replacenodes in Telegram will tell the bot to automatically find the newest node (by build time) and run it |
root\Instance Name\Logs |
Logging directory |
root\Languages |
Language xml files - These files are shared by all instances of Werewolf |
/replacenodes
. Again, the bot will always take whichever node it finds that is the newest, as long as the directory has Node
in the name. do not name any other directory in the root folder anything with Node
in it
Fire up the bot!
If you try to start a game now, you will notice that the bot will just respond with an error. That is because you didn't update the gif ids yet. See the section below for instructions on how to do this.
In order to use GIFs with the bot, you will need to "teach" the bot the new GIF IDs. From Telegram, run /learngif
, the bot will respond with GIF learning = true
. Now send it a GIF, and the bot will reply with an ID. Send the bot all the GIFs you need. In the Node project, go to Helpers > Settings.cs and find the GIF lists. You'll need to remove all of the existing IDs and put in the IDs you just got from the bot.
You can test these by running /dumpgifs
(preferrably in Private Message!). Make sure you check out DevCommands.cs, and look at the DumpGifs()
method - most of it is commented out. Uncomment what you need.