<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sorbot/src/Plugin, branch tmp</title>
<subtitle></subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/'/>
<entry>
<title>tmp; fix/reword</title>
<updated>2017-09-06T21:27:45+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-09-06T21:27:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/commit/?id=712dca5f860529c33ad19e7babf5c471181e2573'/>
<id>712dca5f860529c33ad19e7babf5c471181e2573</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>GitHubCommit: Remove the `Id` type</title>
<updated>2017-08-20T18:42:28+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-20T18:42:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/commit/?id=9e543e593ffe7468789b159f8f5ccf2eb57cb53a'/>
<id>9e543e593ffe7468789b159f8f5ccf2eb57cb53a</id>
<content type='text'>
We're not using this any more so it can be removed. I had added when I
was originally experimenting with getting values from the database and
had been selecting the `id` field.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We're not using this any more so it can be removed. I had added when I
was originally experimenting with getting values from the database and
had been selecting the `id` field.
</pre>
</div>
</content>
</entry>
<entry>
<title>GitHubCommit: Extract language handling to a function</title>
<updated>2017-08-20T18:40:56+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-20T18:38:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/commit/?id=0b20b2b113e68396a8ab4e6b59b349dc9248d85b'/>
<id>0b20b2b113e68396a8ab4e6b59b349dc9248d85b</id>
<content type='text'>
Move the CLI option extracting to a new function that moves the option
parsing logic outside the plugin.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the CLI option extracting to a new function that moves the option
parsing logic outside the plugin.
</pre>
</div>
</content>
</entry>
<entry>
<title>GitHubCommit: Make localisation work</title>
<updated>2017-08-20T18:17:30+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-20T18:17:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/commit/?id=37c39d1267e6211233a98081ddea9fef2a6f05df'/>
<id>37c39d1267e6211233a98081ddea9fef2a6f05df</id>
<content type='text'>
Get the language from the command line options and use it to determine
which localised string to return on error. Wooo!! it works! So cool.

Add French translations for our existing strings.

The code to get the language option is pretty messy for the moment. I
want to factor it out into its own separate function. But at least it's
working now.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Get the language from the command line options and use it to determine
which localised string to return on error. Wooo!! it works! So cool.

Add French translations for our existing strings.

The code to get the language option is pretty messy for the moment. I
want to factor it out into its own separate function. But at least it's
working now.
</pre>
</div>
</content>
</entry>
<entry>
<title>IRC: Send private messages when plugin is `queryOnly`</title>
<updated>2017-08-20T13:15:15+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-20T13:04:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/commit/?id=3f39ebaa923ee5ce05a379313cbb046f093aa66a'/>
<id>3f39ebaa923ee5ce05a379313cbb046f093aa66a</id>
<content type='text'>
If the plugin is defined as `queryOnly`, the response shouldn't be sent
on the channel to everyone, it should instead be sent directly to the
user in a private query message.

Enable this functionality for the Help plugin so that help output only
gets sent to the user requesting help. This ensures other channel
participants don't get an annoyingly long section of output that they
didn't ask for.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the plugin is defined as `queryOnly`, the response shouldn't be sent
on the channel to everyone, it should instead be sent directly to the
user in a private query message.

Enable this functionality for the Help plugin so that help output only
gets sent to the user requesting help. This ensures other channel
participants don't get an annoyingly long section of output that they
didn't ask for.
</pre>
</div>
</content>
</entry>
<entry>
<title>Plugin: Add `queryOnly` field</title>
<updated>2017-08-20T13:15:15+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-20T12:49:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/commit/?id=6009f91efd3dfd57122d2cf98d7255ec99ba8475'/>
<id>6009f91efd3dfd57122d2cf98d7255ec99ba8475</id>
<content type='text'>
A new field that says whether this plugin should only respond via a
private query message to the user instead of responding on the channel
the message was sent from.

This is needed for the Help plugin, which shouldn't flood channels with
lots of extraneous output. Instead, the Help plugin should send the list
of commands directly to the user.

Since most of the time we don't want this behaviour, encode a default of
`False` on the field so that most plugins don't have to define it
manually. This necessitates changing the constructors to use the default
`Plugin` instead.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A new field that says whether this plugin should only respond via a
private query message to the user instead of responding on the channel
the message was sent from.

This is needed for the Help plugin, which shouldn't flood channels with
lots of extraneous output. Instead, the Help plugin should send the list
of commands directly to the user.

Since most of the time we don't want this behaviour, encode a default of
`False` on the field so that most plugins don't have to define it
manually. This necessitates changing the constructors to use the default
`Plugin` instead.
</pre>
</div>
</content>
</entry>
<entry>
<title>Factorial: Include upper bound in description</title>
<updated>2017-08-20T13:15:14+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-20T12:13:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/commit/?id=5d01ba1990e99785b947c2aca71367ea5b21dce2'/>
<id>5d01ba1990e99785b947c2aca71367ea5b21dce2</id>
<content type='text'>
Let users know how much factorial they can calculate.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Let users know how much factorial they can calculate.
</pre>
</div>
</content>
</entry>
<entry>
<title>Factorial: Use `Integer` instead of `Int` for bigger numbers</title>
<updated>2017-08-20T13:15:14+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-20T11:03:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/commit/?id=c543eebfcbd92bb261003dbfd658487b59362a5b'/>
<id>c543eebfcbd92bb261003dbfd658487b59362a5b</id>
<content type='text'>
The `Integer` type has arbitrary precision. This is why the function was
working fine in GCHi but overflowing when I was testing the bot. Use
`Integer` to get the real values we want.

https://stackoverflow.com/questions/36355757/large-numbers-become-negative-in-haskell

Also add a little extra error handling to deal with unexpected numbers.
Now that I think about it, the regex parser isn't going to handle
negative numbers, so we're good on that front. Set an upper bound so we
don't end up spending a lot of time trying to calculate numbers and
potentially segfault if huge numbers are given.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `Integer` type has arbitrary precision. This is why the function was
working fine in GCHi but overflowing when I was testing the bot. Use
`Integer` to get the real values we want.

https://stackoverflow.com/questions/36355757/large-numbers-become-negative-in-haskell

Also add a little extra error handling to deal with unexpected numbers.
Now that I think about it, the regex parser isn't going to handle
negative numbers, so we're good on that front. Set an upper bound so we
don't end up spending a lot of time trying to calculate numbers and
potentially segfault if huge numbers are given.
</pre>
</div>
</content>
</entry>
<entry>
<title>Factorial: Use `Integral`</title>
<updated>2017-08-20T13:15:14+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-20T10:45:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/commit/?id=de7e162e6865b9e805154b7c7178406309746e6f'/>
<id>de7e162e6865b9e805154b7c7178406309746e6f</id>
<content type='text'>
Apparently that's short for `Enum a, Num a`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Apparently that's short for `Enum a, Num a`.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add Factorial plugin</title>
<updated>2017-08-20T13:11:52+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-20T10:42:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/commit/?id=e94543c1b42bac8928aa8bf4fa3341563f7631b8'/>
<id>e94543c1b42bac8928aa8bf4fa3341563f7631b8</id>
<content type='text'>
This plugin calculates factorials. It's not super optimised, but works
for small inputs.

Adds the 'text-show' plugin to convert the resulting integer to a
`Data.Text` to be returned by the plugin action.

At first I had tried /^\d+!$/ for the regex match, but that produced
this error:

    sorbot/src/Plugin/Factorial.hs:14:24: error:
        lexical error in string/character literal at character 'd'

Tried to fix that by using /^\\d+!$/, but that didn't match anything.
Then tried a long-form character class, /^[:digit:]+!$/, which TDFA
implies it supports, but a quick look at the code seems to indicate that
those parts were removed or commented out. Not sure what was going on
with that. So instead went for the remaining solution, a `0-9` character
class.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This plugin calculates factorials. It's not super optimised, but works
for small inputs.

Adds the 'text-show' plugin to convert the resulting integer to a
`Data.Text` to be returned by the plugin action.

At first I had tried /^\d+!$/ for the regex match, but that produced
this error:

    sorbot/src/Plugin/Factorial.hs:14:24: error:
        lexical error in string/character literal at character 'd'

Tried to fix that by using /^\\d+!$/, but that didn't match anything.
Then tried a long-form character class, /^[:digit:]+!$/, which TDFA
implies it supports, but a quick look at the code seems to indicate that
those parts were removed or commented out. Not sure what was going on
with that. So instead went for the remaining solution, a `0-9` character
class.
</pre>
</div>
</content>
</entry>
</feed>
