Sir Lancelot has risen!

Recently I have taken quite a bit of interest in Python and sought out an opportunity to make a project in it. The idea sprung about a week ago when a couple of friends and I were on Discord together talking about Python bots running on the server using the Discord API adding pretty cool features (if I might say so myself), such as a bank to keep track of virtual currency on the server used on other bots and permissions. Think of a little community with their own market place and everything on a virtual platform. Isn’t that cool!

After a lot thinking I finally got the idea of creating a bot for translations and dictionary corrections on the server – kind of like a Grammar-Nazi that is online 24/7 busy watching you! I started seeking out documentation on how I could connect this glorious bot to discord. Unfortunately discord has no “official” documentation on this (although they support developers creating applications for discord). Eventually I stumbled upon a python wrapper API someone wrote called Discord.py which had everything I needed to create this bot. At this stage I was uncertain about the name of the bot and called it test-bot; how boring.

Now that I have all the basic resources – such as the discord API in the language I want to code and the idea of the project – I still had to get the API for the dictionary/translation sorted. I initially thought Google would have a nice free API to use, but for some reason they charge $20 per 1 million characters translated (a bit heavy on my pocket). I then found Yandex (The Russian Google) which had a free translate API with certain limitations, of course. The limitations included only having 1 million characters per day and 10 million characters per month, which isn’t bad at all.

Finally I was ready to code the bot! I went through a bunch of issues – such as figuring out how the token works and how bots get added to the server. Now some of you would be saying: “How were you struggling? It’s so straight-forward.” I also thought that initially until the python API had three different methods for doing the same exact thing but differently. I eventually figured it out by learning from another python bot’s code and also finding different resources to compare with each other.

After working out all the kinks in calling the bot from Discord, I birthed Sir Lancelot! My very own python Discord bot running on it’s own (with the help of the discord wrapper API).

Here is the git-hub repository Sir Lancelot sleeps, waiting to be called upon for service.